From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web11.13644.1674563588500985608 for ; Tue, 24 Jan 2023 04:33:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gKWPTdV0; spf=pass (domain: kernel.org, ip: 145.40.68.75, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 475A1B8114A for ; Tue, 24 Jan 2023 12:33:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F023AC4339B for ; Tue, 24 Jan 2023 12:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674563585; bh=i8ib6m77Q5+0CudGBEb4678nUEXPHWgO5HRnjCp+TDw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gKWPTdV04HKeHVfWYz8qZ1zREoyrlz3ylWPXqH+69wyxZ7CZxlegxiXc4iXbp86nO jrQ5Y0R7oCCzf9VqG205heB3/9gvUktorhlyeXZgTbOnSyFpCt8a/7BeVmU7TW7qI/ IoRz9hDBYkEO5DOSckjlB7f+MKfRiF3mC+2F0x7TwbWvmSJ3CIVc0j5Oj+2YGdVhMr gDmUeUGmzbupPOrr6KSTqk3p5VJWHbr+NCye8lju0Ih/6219sBxfww2AA9GUHFKINs IgXCfNnJIhtgIPazd4GsmX+Bgunw8YnoeTZnJk0pdyjFmH2ZCYA0CWHvx9Bqz2kBcC O8yW9MfD1rI9w== Received: by mail-lj1-f180.google.com with SMTP id c3so16552366ljh.1 for ; Tue, 24 Jan 2023 04:33:04 -0800 (PST) X-Gm-Message-State: AFqh2koTHhs76dhYJ6Aj8blulH0M7OoVhpdo7XawNrBbKs2ZGyxlDQRY i50X6voAc7DCRcu5/4LL0KXj9lWwwIvt++dWpwk= X-Google-Smtp-Source: AMrXdXuk3/V/VgJQrUt1Z1U5reDMbktj7G7RkOP+Ut8ssab7uVVQDU4eJWSd04xBo6h6K/dIWX4VKdW+/Y+4WO7aquw= X-Received: by 2002:a2e:8713:0:b0:28b:c9a8:3bf5 with SMTP id m19-20020a2e8713000000b0028bc9a83bf5mr1360766lji.152.1674563582968; Tue, 24 Jan 2023 04:33:02 -0800 (PST) MIME-Version: 1.0 References: <173AEF7243293292.25137@groups.io> In-Reply-To: From: "Ard Biesheuvel" Date: Tue, 24 Jan 2023 13:32:51 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH] StandaloneMmPkg/StandaloneMmMemLib: Update AARCH64 address size To: "Milosek, Damian" Cc: "devel@edk2.groups.io" , "sami.mujawar@arm.com" , "Yao, Jiewen" Content-Type: text/plain; charset="UTF-8" On Tue, 24 Jan 2023 at 13:20, Milosek, Damian wrote: > > > > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ard Biesheuvel > Sent: Monday, January 23, 2023 6:46 PM > To: Milosek, Damian > Cc: devel@edk2.groups.io; sami.mujawar@arm.com; Yao, Jiewen > Subject: Re: [edk2-devel] [PATCH] StandaloneMmPkg/StandaloneMmMemLib: Update AARCH64 address size > > On Mon, 23 Jan 2023 at 17:14, Milosek, Damian wrote: > > > > > > > > -----Original Message----- > > From: Ard Biesheuvel > > Sent: Monday, January 23, 2023 5:05 PM > > To: Milosek, Damian > > Cc: devel@edk2.groups.io; sami.mujawar@arm.com; Yao, Jiewen > > > > Subject: Re: [PATCH] StandaloneMmPkg/StandaloneMmMemLib: Update > > AARCH64 address size > > > > On Mon, 23 Jan 2023 at 16:51, Milosek, Damian wrote: > > > > > > > > > > > > > > > > > > From: devel@edk2.groups.io On Behalf Of > > > Milosek, Damian > > > Sent: Monday, January 16, 2023 2:51 PM > > > To: devel@edk2.groups.io > > > Cc: Milosek, Damian > > > Subject: [edk2-devel] [PATCH] StandaloneMmPkg/StandaloneMmMemLib: > > > Update AARCH64 address size > > > > > > > > > > > > Enable StandaloneMmMemLib to use longer physical addresses than 36 bits. > > > > > > > What is the purpose of this change? > > > > - Making this Lib working for newer systems that use longer addresses. > > > > What is the symptom? How is it failing currently? > > - Failure occurs in the first check in MmIsBufferOutsideMmValid () function when using longer address. > > > > According to ARM "Learn the architecture - AArch64 memory management" > > > > > > since Armv8.2-A physical address size was extended to 52 bits. > > > > > > https://developer.arm.com/documentation/101811/0102/Address-spaces > > > > > > > This is an optional extension. Which hardware are you using that implements this extension? > > > > - System with Armv9-A Neoverse CPU cores. > > > > Which system? What does the memory map look like? > > - It is not productized yet so cannot give any more info. However it seems that specific system is not relevant here. > Current definition assumes max 36 bits for AARCH64 which is not the case anymore. > Fair enough. The problem with 52 bit support is that when using 4k pages (which is the only page size supported by EFI), the page table entry layout is different, and the shareability of a region is derived in a different manner. None of this is implemented in the MMU library, and I would actually prefer to avoid this if possible. We can increase this to 48 without any problems, though.