From nobody Thu Oct 19 11:07:33 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SB4gT3gmvz4xJZX for ; Thu, 19 Oct 2023 11:07:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SB4gT14b8z3dpr for ; Thu, 19 Oct 2023 11:07:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697713653; a=rsa-sha256; cv=none; b=FNIVM9gbnkBgnumC33PJmvJmrYThY+rsFIhigpGYjDBbMSpSSuq5z/HYVfTPCcCi3MAC79 4zx/c41LWFA7hA9fSP79HnDiCUwkudy8YpKuDFkWusZZanEtLXHi3JWa1peeqv9A+mYkQ2 9YoSJFCBpxlkFcyOSTJCHEshoX4yrCY8CNcPudi5BLy/sdpM/AUJFl9Pn0FI/ds5ElEWAQ 5PhvwsN/X/4juMltMtBo/u2B8SVbbhSfRIEw1BuBj6afT2ZZJ/lFWy9WsIeYQjZ8ipnK8n 7nlVXiZ67HhLbUNF6TbXnoXPhS8ntxT5kuwyoTnAFl0xHPrmRmZFz21lfW/1RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697713653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYeDLLaQvp19zmG08WgoSycD22OghGaOJjZhdHa3dcc=; b=BF/h1NjAedt6/ddogNtEE/SO/FD0HeXCkbYL/9wu0Cr63e3KkWMZqJe0Fiii241JO6q0qp VmI1ig0A6Ry1xiBgFRJxXA7d44i2/wppiDK/uDvNhQ4MgD2x6inzzXwvylcz6JNM+Bc6iT Q9k6sFKacsbxhgthzzcAvoTWOAgS2LPcbcnxqVlagc3k8hgQW0fV0brUkhhUOSW5dIgCp7 bZJpg944AywflVRN3BEzDNXsSgKQDJ9fCxO2BbYOsH0C28T8UOPVxswXzuv2iQbW7lBrXF HyH8MF3xIoEGeKMUOcbwr0/rNYUkKNwYPk8XfOo29rW+4gJg4348ts6RweBrVQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SB4gT07hxzmpV for ; Thu, 19 Oct 2023 11:07:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 39JB7W8j025251 for ; Thu, 19 Oct 2023 11:07:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 39JB7Whq025250 for freebsd-arm@FreeBSD.org; Thu, 19 Oct 2023 11:07:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-arm@FreeBSD.org Subject: [Bug 274592] bus_dmamem_alloc()/bus_dmamap_load returns physical address outside the tag low/high bounds Date: Thu, 19 Oct 2023 11:07:33 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: arm X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: shafaisal.us@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-arm@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274592 Bug ID: 274592 Summary: bus_dmamem_alloc()/bus_dmamap_load returns physical address outside the tag low/high bounds Product: Base System Version: 15.0-CURRENT Hardware: arm64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: shafaisal.us@gmail.com Hello Team,=20 We are using the below 3 routines to alloc DMA memory for one of our devices connected through PCIe interface. Out of 10 rebooted 4-5 times we get the address outside greated 32G range of addresses, due to which our device functionality is effected and there is a crash seen. error =3D bus_dma_tag_create(bus_get_dma_tag(dev), PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, 128*1024*1024, 1, 128*1024*1024, BUS_DMA_COHERENT, NULL, NULL, &dma_tag); error =3D bus_dmamem_alloc(dma_tag, &vaddr, BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERE= NT, &dma_map); error =3D bus_dmamap_load(dma_tag, dma_map, vaddr, 128*1024*1024, dma_mem_callback,=20 &dma_paddr, BUS_DMA_NOWAIT);=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Below are the addresses we get for Working and non-working case Working case vaddr and dma_paddr: DMA phys addr with arm64_address_translate is 0xff000000cf000b80 for vaddr 0xffff00007ec00000 DMA phys addr with vtophys is 0xcf000000 for vaddr 0xffff00007ec00000 Non-Working case vaddr and dma_paddr: DMA phys addr with arm64_address_translate is 0xff00000163000b80 for vaddr 0xffff00007ec00000 DMA phys addr with vtophys is 0x163000000 for vaddr 0xffff00007ec00000 --=20 You are receiving this mail because: You are the assignee for the bug.=