From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 2CD06AC18D3 for ; Tue, 30 Jan 2024 19:05:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=agsX8Mc8HgsUYXEeHo6Xc+FqjOmnNWgmRsLUVTSRvBM=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706641502; v=1; b=ECRi1/nVifGmx1Ijwjvjvg5it+y3e63x6WJllnoIctMb4orsU9py566tF0ass0tjszfY0pAQ 9A1tRkWRCiPmD9SRlSHZbAGfwQKR8UeDrNEDqoXKL3I3MXJpfbgEWXmUqKXTw6CgyTylQh42gDL /KuhBxZCZCWujt/owWaDijtk= X-Received: by 127.0.0.2 with SMTP id F2hDYY7687511xJ7hyUFCsX8; Tue, 30 Jan 2024 11:05:02 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.4968.1706641501984961190 for ; Tue, 30 Jan 2024 11:05:02 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-196-1NqZsiOIOyqui9TjmMVGMQ-1; Tue, 30 Jan 2024 14:04:56 -0500 X-MC-Unique: 1NqZsiOIOyqui9TjmMVGMQ-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4377D10651EB; Tue, 30 Jan 2024 19:04:56 +0000 (UTC) X-Received: from [10.39.192.28] (unknown [10.39.192.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBEF61121312; Tue, 30 Jan 2024 19:04:54 +0000 (UTC) Message-ID: <023e13d0-2473-244a-63e7-9adf6e505be4@redhat.com> Date: Tue, 30 Jan 2024 20:04:53 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 3/5] OvmfPkg/ResetVector: improve page table flag names To: devel@edk2.groups.io, kraxel@redhat.com Cc: Erdem Aktas , Oliver Steffen , Jiewen Yao , Ard Biesheuvel , Min Xu , Tom Lendacky , Michael Roth , Liming Gao References: <20240130123204.764453-1-kraxel@redhat.com> <20240130123204.764453-4-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240130123204.764453-4-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: uFZgCL2DA2fqc1TDQVKU9bZgx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="ECRi1/nV"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 1/30/24 13:32, Gerd Hoffmann wrote: > Add comments, rename some of the PAGE_* flags and combined attributes. > Specifically use "LARGEPAGE" instead of "2M" because that bit is used > for both 2M and 1G large pages. >=20 > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/ResetVector/Ia32/PageTables64.asm | 39 +++++++++++++---------- > 1 file changed, 22 insertions(+), 17 deletions(-) >=20 > diff --git a/OvmfPkg/ResetVector/Ia32/PageTables64.asm b/OvmfPkg/ResetVec= tor/Ia32/PageTables64.asm > index 317cad430f29..6fec6f2beeea 100644 > --- a/OvmfPkg/ResetVector/Ia32/PageTables64.asm > +++ b/OvmfPkg/ResetVector/Ia32/PageTables64.asm > @@ -10,6 +10,7 @@ > =20 > BITS 32 > =20 > +; common for all levels > %define PAGE_PRESENT 0x01 > %define PAGE_READ_WRITE 0x02 > %define PAGE_USER_SUPERVISOR 0x04 > @@ -17,25 +18,29 @@ BITS 32 > %define PAGE_CACHE_DISABLE 0x010 > %define PAGE_ACCESSED 0x020 > %define PAGE_DIRTY 0x040 > -%define PAGE_PAT 0x080 > %define PAGE_GLOBAL 0x0100 > -%define PAGE_2M_MBO 0x080 > -%define PAGE_2M_PAT 0x01000 > + > +; page table entries (level 1) > +%define PAGE_PTE_PAT 0x080 > + > +; page directory entries (level 2+) > +%define PAGE_PDE_LARGEPAGE 0x080 > +%define PAGE_PDE_PAT 0x01000 Interesting: PAGE_PAT and PAGE_2M_PAT appear unused! But the patch is still fine; thank you for it! Reviewed-by: Laszlo Ersek Laszlo > =20 > %define PAGE_4K_PDE_ATTR (PAGE_ACCESSED + \ > PAGE_DIRTY + \ > PAGE_READ_WRITE + \ > PAGE_PRESENT) > =20 > -%define PAGE_2M_PDE_ATTR (PAGE_2M_MBO + \ > - PAGE_ACCESSED + \ > - PAGE_DIRTY + \ > - PAGE_READ_WRITE + \ > - PAGE_PRESENT) > +%define PAGE_PDE_LARGEPAGE_ATTR (PAGE_PDE_LARGEPAGE + \ > + PAGE_ACCESSED + \ > + PAGE_DIRTY + \ > + PAGE_READ_WRITE + \ > + PAGE_PRESENT) > =20 > -%define PAGE_PDP_ATTR (PAGE_ACCESSED + \ > - PAGE_READ_WRITE + \ > - PAGE_PRESENT) > +%define PAGE_PDE_DIRECTORY_ATTR (PAGE_ACCESSED + \ > + PAGE_READ_WRITE + \ > + PAGE_PRESENT) > =20 > %define TDX_BSP 1 > %define TDX_AP 2 > @@ -84,19 +89,19 @@ clearPageTablesMemoryLoop: > ; > ; Top level Page Directory Pointers (1 * 512GB entry) > ; > - mov dword[PT_ADDR (0)], PT_ADDR (0x1000) + PAGE_PDP_ATTR > + mov dword[PT_ADDR (0)], PT_ADDR (0x1000) + PAGE_PDE_DIRECTORY_AT= TR > mov dword[PT_ADDR (4)], edx > =20 > ; > ; Next level Page Directory Pointers (4 * 1GB entries =3D> 4GB) > ; > - mov dword[PT_ADDR (0x1000)], PT_ADDR (0x2000) + PAGE_PDP_ATTR > + mov dword[PT_ADDR (0x1000)], PT_ADDR (0x2000) + PAGE_PDE_DIRECTO= RY_ATTR > mov dword[PT_ADDR (0x1004)], edx > - mov dword[PT_ADDR (0x1008)], PT_ADDR (0x3000) + PAGE_PDP_ATTR > + mov dword[PT_ADDR (0x1008)], PT_ADDR (0x3000) + PAGE_PDE_DIRECTO= RY_ATTR > mov dword[PT_ADDR (0x100C)], edx > - mov dword[PT_ADDR (0x1010)], PT_ADDR (0x4000) + PAGE_PDP_ATTR > + mov dword[PT_ADDR (0x1010)], PT_ADDR (0x4000) + PAGE_PDE_DIRECTO= RY_ATTR > mov dword[PT_ADDR (0x1014)], edx > - mov dword[PT_ADDR (0x1018)], PT_ADDR (0x5000) + PAGE_PDP_ATTR > + mov dword[PT_ADDR (0x1018)], PT_ADDR (0x5000) + PAGE_PDE_DIRECTO= RY_ATTR > mov dword[PT_ADDR (0x101C)], edx > =20 > ; > @@ -107,7 +112,7 @@ pageTableEntriesLoop: > mov eax, ecx > dec eax > shl eax, 21 > - add eax, PAGE_2M_PDE_ATTR > + add eax, PAGE_PDE_LARGEPAGE_ATTR > mov [ecx * 8 + PT_ADDR (0x2000 - 8)], eax > mov [(ecx * 8 + PT_ADDR (0x2000 - 8)) + 4], edx > loop pageTableEntriesLoop -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114815): https://edk2.groups.io/g/devel/message/114815 Mute This Topic: https://groups.io/mt/104052210/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-