From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA147C54EAA for ; Fri, 27 Jan 2023 15:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:CC:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=q/hCZczvdRKoVMqCJ/1PpXwqjIAwLODoNrd5mE4a/EQ=; b=wVa2MXuWZ5CSnbl7UKygsbaBzJ eThi+h/LgvMyc3NC98EiFZH+oKM9rmPsM6Ng+vsOUhSpIIIBP+0NVjBsXq12wNsa0JOT5VFRFtwF0 2kjVpqjkebG3g8mPXNDS/cgB+9DbtJjLqevLzO5hYFf2+ZrLVzg+cZRPJlkWUDc0h0SE3J+/B6T68 twpp1wi82p2kRumYXcrfEw4mtDov9GijBQS70F8ezFC3Wi5YAoRb46SHPUbdBQwnVgKIUgUuAKbOh 2gIsWG1rPLQq1RXi6tOC9lq5TVF83PpvOQxZw5Ajfj24Uc2cA4H8yv5gPjfgN6d6reGVUmKxwHhi2 MX1TqK6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLQeN-00FSkI-LF; Fri, 27 Jan 2023 15:28:23 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLQeH-00FSiF-L4 for linux-riscv@lists.infradead.org; Fri, 27 Jan 2023 15:28:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1674833297; x=1706369297; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=CtNAdAonBFHUKepZl7RaqISOJYoGgnfbvYJNH8B3Y0k=; b=ZDQngsMbnccUXU9PgyceClJm5M9DFwLJU1UazeZdQrDzJdVDZS53akPn icqhDXGmI9ige4zFzF/XA60Fazzpjz12rvVc8LsXlkbVNOY7qVVMyFHR7 Y3HZMrHWGWTRNtRdeZpOwYmNbAto8X4Bnh1vFXgJxFRGocURxvQzP2Jgh rPfMEq3DFOzoFSg6kBWq4oaLzRFIxD207f+WuDBMBI+cz6wjIZtwlDktj +RfOJ6ICl1J2mWqtklke6Zlbc6R5v/Lj8IE5Erzq4UGcVN+bDRzjjXhxc BpBX26r6cFbr4GlOMhl4dfkHyFNgcx8guqTPa9ZiVNfc5fenOXI3kAccZ A==; X-IronPort-AV: E=Sophos;i="5.97,251,1669100400"; d="asc'?scan'208";a="197710525" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jan 2023 08:28:11 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 27 Jan 2023 08:28:06 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 27 Jan 2023 08:28:04 -0700 Date: Fri, 27 Jan 2023 15:27:40 +0000 From: Conor Dooley To: Alexandre Ghiti CC: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Ard Biesheuvel , Conor Dooley , , , , Subject: Re: [PATCH v3 3/6] riscv: Move DTB_EARLY_BASE_VA to the kernel address space Message-ID: References: <20230125082333.1577572-1-alexghiti@rivosinc.com> <20230125082333.1577572-4-alexghiti@rivosinc.com> MIME-Version: 1.0 In-Reply-To: <20230125082333.1577572-4-alexghiti@rivosinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230127_072817_826608_525A417A X-CRM114-Status: GOOD ( 19.49 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4870526893182159110==" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org --===============4870526893182159110== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Z01ixQvrSdrQQAm3" Content-Disposition: inline --Z01ixQvrSdrQQAm3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Alex, On Wed, Jan 25, 2023 at 09:23:30AM +0100, Alexandre Ghiti wrote: > The early virtual address should lie in the kernel address space for > inline kasan instrumentation to succeed, otherwise kasan tries to > dereference an address that does not exist in the address space (since > kasan only maps *kernel* address space, not the userspace). >=20 > Simply use the very first address of the kernel address space for the > early fdt mapping. >=20 > It allowed an Ubuntu kernel to boot successfully with inline > instrumentation. >=20 > Signed-off-by: Alexandre Ghiti Been poking around in this area the last few days trying to hunt down some bugs... Things look functionally the same w/ this patch and we do get rid of the odd looking pointer which is nice. Reviewed-by: Conor Dooley Probably would've made the cause of 50e63dd8ed92 ("riscv: fix reserved memory setup") more difficult to find so glad I got that out of the way well before this patch! Thanks, Conor. > --- > arch/riscv/mm/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 478d6763a01a..87f6a5d475a6 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -57,7 +57,7 @@ unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsign= ed long)] > EXPORT_SYMBOL(empty_zero_page); > =20 > extern char _start[]; > -#define DTB_EARLY_BASE_VA PGDIR_SIZE > +#define DTB_EARLY_BASE_VA (ADDRESS_SPACE_END - (PTRS_PER_PGD / 2 * = PGDIR_SIZE) + 1) > void *_dtb_early_va __initdata; > uintptr_t _dtb_early_pa __initdata; > =20 > --=20 > 2.37.2 >=20 >=20 --Z01ixQvrSdrQQAm3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHQEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCY9PtbAAKCRB4tDGHoIJi 0u7KAPY1hCi3Va5fAfv37uYg8QCBL7X4ZCQl3ls8gDg6rGp9AQDsdy5FKbSVrpX1 z1qeXbmq0/jC3ZakOc10BTCtvty7Dw== =w080 -----END PGP SIGNATURE----- --Z01ixQvrSdrQQAm3-- --===============4870526893182159110== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv --===============4870526893182159110==--