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 E013A7803CD for ; Tue, 30 Jan 2024 19:47:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=bX4QfL5zPLAMs2VomIvtpSFBf0nuDdih7Uxto72FFfo=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706644023; v=1; b=mI+WFd3IS15ELpsLi7OT2Z5txLoInj40UV7S05+EGRpljPJSvr2WLyKTqLRtpjg1HkytM3Jc 4LKqKXLXcmnaUxs7M/eC6Kk8lH6Wl51ddqqjkky194cJDveW7cYYTRYUvpDanTKGlWHSUZ8vYmx rCLJYbCAW5jv1ddwULmHUglY= X-Received: by 127.0.0.2 with SMTP id 0AXAYY7687511xYCCgjCJGVO; Tue, 30 Jan 2024 11:47:03 -0800 X-Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com [209.85.221.170]) by mx.groups.io with SMTP id smtpd.web10.6075.1706644022688856275 for ; Tue, 30 Jan 2024 11:47:02 -0800 X-Received: by mail-vk1-f170.google.com with SMTP id 71dfb90a1353d-4bd9b71456fso853328e0c.2 for ; Tue, 30 Jan 2024 11:47:02 -0800 (PST) X-Gm-Message-State: CJgtnGRvr0j1p5gdKgf8R17ax7686176AA= X-Google-Smtp-Source: AGHT+IHnI5DrKtsccfw3RTJ53EHLe5s8ewaMgCe4KwWSpi5ZePc53LcCwTHAuOLSbllHU6IZk4iZe/tNX4UQW4NrrP8= X-Received: by 2002:a05:6122:ca5:b0:4bb:36bf:78f5 with SMTP id ba37-20020a0561220ca500b004bb36bf78f5mr4768101vkb.16.1706644021525; Tue, 30 Jan 2024 11:47:01 -0800 (PST) MIME-Version: 1.0 References: <20240130123204.764453-1-kraxel@redhat.com> <20240130123204.764453-4-kraxel@redhat.com> In-Reply-To: <20240130123204.764453-4-kraxel@redhat.com> From: "Pedro Falcato" Date: Tue, 30 Jan 2024 19:46:50 +0000 Message-ID: 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 , Laszlo Ersek 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,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: 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=mI+WFd3I; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.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 Tue, Jan 30, 2024 at 12:32=E2=80=AFPM 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. > > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/ResetVector/Ia32/PageTables64.asm | 39 +++++++++++++---------- > 1 file changed, 22 insertions(+), 17 deletions(-) > > 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 @@ > > BITS 32 > > +; 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 > > %define PAGE_4K_PDE_ATTR (PAGE_ACCESSED + \ > PAGE_DIRTY + \ > PAGE_READ_WRITE + \ > PAGE_PRESENT) > > -%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) > > -%define PAGE_PDP_ATTR (PAGE_ACCESSED + \ > - PAGE_READ_WRITE + \ > - PAGE_PRESENT) > +%define PAGE_PDE_DIRECTORY_ATTR (PAGE_ACCESSED + \ > + PAGE_READ_WRITE + \ > + PAGE_PRESENT) > > %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 > > ; > ; 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 Technically, if we want to be pedantic, these are PDPTEs (or PDPs I guess), so PDE is misleading here. --=20 Pedro -=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 (#114826): https://edk2.groups.io/g/devel/message/114826 Mute This Topic: https://groups.io/mt/104052210/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-