MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 45 ++++++++++-------- UefiCpuPkg/CpuDxe/CpuDxe.c | 5 ++ UefiCpuPkg/CpuDxe/CpuDxe.h | 9 ++++ UefiCpuPkg/CpuDxe/CpuPageTable.c | 99 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 18 deletions(-)
There're two issues here actually. From GCD perspective, its SetMemorySpaceAttributes() method doesn't accept page related attributes. That means users cannot use it to change page attributes, and have to turn to CPU arch protocol to do it, which is not be allowed by PI spec. From CpuDxe driver perspective, it doesn't update GCD memory attributes from current page table setup during its initialization. So the memory attributes in GCD might not reflect all memory attributes in real world. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Suggested-by: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Jian J Wang (2): UefiCpuPkg/CpuDxe: Fix out-of-sync issue in CpuDxe MdeModulePkg/Core: Fix out-of-sync issue in GCD MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 45 ++++++++++-------- UefiCpuPkg/CpuDxe/CpuDxe.c | 5 ++ UefiCpuPkg/CpuDxe/CpuDxe.h | 9 ++++ UefiCpuPkg/CpuDxe/CpuPageTable.c | 99 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 18 deletions(-) -- 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Jiewen, Any comments on this patch? -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jian J Wang Sent: Tuesday, September 19, 2017 2:10 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek <lersek@redhat.com>; Yao, Jiewen <jiewen.yao@intel.com>; Dong, Eric <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> Subject: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver There're two issues here actually. From GCD perspective, its SetMemorySpaceAttributes() method doesn't accept page related attributes. That means users cannot use it to change page attributes, and have to turn to CPU arch protocol to do it, which is not be allowed by PI spec. From CpuDxe driver perspective, it doesn't update GCD memory attributes from current page table setup during its initialization. So the memory attributes in GCD might not reflect all memory attributes in real world. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Suggested-by: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Jian J Wang (2): UefiCpuPkg/CpuDxe: Fix out-of-sync issue in CpuDxe MdeModulePkg/Core: Fix out-of-sync issue in GCD MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 45 ++++++++++-------- UefiCpuPkg/CpuDxe/CpuDxe.c | 5 ++ UefiCpuPkg/CpuDxe/CpuDxe.h | 9 ++++ UefiCpuPkg/CpuDxe/CpuPageTable.c | 99 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 18 deletions(-) -- 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Hi I take a look at the driver. I think the update is good. Would you please share what test you have done with the updated UEFI memory map? Such as UEFI Windows boot, UEFI Linux boot? Thank you Yao Jiewen > -----Original Message----- > From: Wang, Jian J > Sent: Wednesday, September 20, 2017 1:12 PM > To: Wang, Jian J <jian.j.wang@intel.com>; edk2-devel@lists.01.org > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek > <lersek@redhat.com>; Yao, Jiewen <jiewen.yao@intel.com>; Dong, Eric > <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> > Subject: RE: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU > driver > > Jiewen, > > Any comments on this patch? > > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jian J > Wang > Sent: Tuesday, September 19, 2017 2:10 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek > <lersek@redhat.com>; Yao, Jiewen <jiewen.yao@intel.com>; Dong, Eric > <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> > Subject: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver > > There're two issues here actually. > > From GCD perspective, its SetMemorySpaceAttributes() method doesn't > accept page related attributes. That means users cannot use it to > change page attributes, and have to turn to CPU arch protocol to do it, > which is not be allowed by PI spec. > > From CpuDxe driver perspective, it doesn't update GCD memory attributes > from current page table setup during its initialization. So the memory > attributes in GCD might not reflect all memory attributes in real world. > > Cc: Jiewen Yao <jiewen.yao@intel.com> > Cc: Eric Dong <eric.dong@intel.com> > Cc: Star Zeng <star.zeng@intel.com> > Cc: Laszlo Ersek <lersek@redhat.com> > Cc: Michael Kinney <michael.d.kinney@intel.com> > Suggested-by: Jiewen Yao <jiewen.yao@intel.com> > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jian J Wang <jian.j.wang@intel.com> > > Jian J Wang (2): > UefiCpuPkg/CpuDxe: Fix out-of-sync issue in CpuDxe > MdeModulePkg/Core: Fix out-of-sync issue in GCD > > MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 45 ++++++++++-------- > UefiCpuPkg/CpuDxe/CpuDxe.c | 5 ++ > UefiCpuPkg/CpuDxe/CpuDxe.h | 9 ++++ > UefiCpuPkg/CpuDxe/CpuPageTable.c | 99 > ++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 140 insertions(+), 18 deletions(-) > > -- > 2.14.1.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Jiewen, Yes. The patch has passed the validation of the UEFI booting Windows 10, Windows 7 and Fedora 25. If no comments from you and others, I'll push the patch to upstream soon. Thanks, Jian Wang -----Original Message----- From: Yao, Jiewen Sent: Wednesday, September 20, 2017 2:08 PM To: Wang, Jian J <jian.j.wang@intel.com>; edk2-devel@lists.01.org Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek <lersek@redhat.com>; Dong, Eric <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> Subject: RE: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver Hi I take a look at the driver. I think the update is good. Would you please share what test you have done with the updated UEFI memory map? Such as UEFI Windows boot, UEFI Linux boot? Thank you Yao Jiewen > -----Original Message----- > From: Wang, Jian J > Sent: Wednesday, September 20, 2017 1:12 PM > To: Wang, Jian J <jian.j.wang@intel.com>; edk2-devel@lists.01.org > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek > <lersek@redhat.com>; Yao, Jiewen <jiewen.yao@intel.com>; Dong, Eric > <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> > Subject: RE: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU > driver > > Jiewen, > > Any comments on this patch? > > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jian J > Wang > Sent: Tuesday, September 19, 2017 2:10 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek > <lersek@redhat.com>; Yao, Jiewen <jiewen.yao@intel.com>; Dong, Eric > <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> > Subject: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver > > There're two issues here actually. > > From GCD perspective, its SetMemorySpaceAttributes() method doesn't > accept page related attributes. That means users cannot use it to > change page attributes, and have to turn to CPU arch protocol to do it, > which is not be allowed by PI spec. > > From CpuDxe driver perspective, it doesn't update GCD memory attributes > from current page table setup during its initialization. So the memory > attributes in GCD might not reflect all memory attributes in real world. > > Cc: Jiewen Yao <jiewen.yao@intel.com> > Cc: Eric Dong <eric.dong@intel.com> > Cc: Star Zeng <star.zeng@intel.com> > Cc: Laszlo Ersek <lersek@redhat.com> > Cc: Michael Kinney <michael.d.kinney@intel.com> > Suggested-by: Jiewen Yao <jiewen.yao@intel.com> > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jian J Wang <jian.j.wang@intel.com> > > Jian J Wang (2): > UefiCpuPkg/CpuDxe: Fix out-of-sync issue in CpuDxe > MdeModulePkg/Core: Fix out-of-sync issue in GCD > > MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 45 ++++++++++-------- > UefiCpuPkg/CpuDxe/CpuDxe.c | 5 ++ > UefiCpuPkg/CpuDxe/CpuDxe.h | 9 ++++ > UefiCpuPkg/CpuDxe/CpuPageTable.c | 99 > ++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 140 insertions(+), 18 deletions(-) > > -- > 2.14.1.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Thanks. I have no other comments. From: Wang, Jian J Sent: Wednesday, September 20, 2017 3:54 PM To: Yao, Jiewen <jiewen.yao@intel.com>; edk2-devel@lists.01.org Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek <lersek@redhat.com>; Dong, Eric <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> Subject: RE: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver Jiewen, Yes. The patch has passed the validation of the UEFI booting Windows 10, Windows 7 and Fedora 25. If no comments from you and others, I'll push the patch to upstream soon. Thanks, Jian Wang -----Original Message----- From: Yao, Jiewen Sent: Wednesday, September 20, 2017 2:08 PM To: Wang, Jian J <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> Cc: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>; Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>>; Dong, Eric <eric.dong@intel.com<mailto:eric.dong@intel.com>>; Zeng, Star <star.zeng@intel.com<mailto:star.zeng@intel.com>> Subject: RE: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver Hi I take a look at the driver. I think the update is good. Would you please share what test you have done with the updated UEFI memory map? Such as UEFI Windows boot, UEFI Linux boot? Thank you Yao Jiewen > -----Original Message----- > From: Wang, Jian J > Sent: Wednesday, September 20, 2017 1:12 PM > To: Wang, Jian J <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> > Cc: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>; Laszlo Ersek > <lersek@redhat.com<mailto:lersek@redhat.com>>; Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; Dong, Eric > <eric.dong@intel.com<mailto:eric.dong@intel.com>>; Zeng, Star <star.zeng@intel.com<mailto:star.zeng@intel.com>> > Subject: RE: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU > driver > > Jiewen, > > Any comments on this patch? > > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jian J > Wang > Sent: Tuesday, September 19, 2017 2:10 PM > To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> > Cc: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>; Laszlo Ersek > <lersek@redhat.com<mailto:lersek@redhat.com>>; Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; Dong, Eric > <eric.dong@intel.com<mailto:eric.dong@intel.com>>; Zeng, Star <star.zeng@intel.com<mailto:star.zeng@intel.com>> > Subject: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver > > There're two issues here actually. > > From GCD perspective, its SetMemorySpaceAttributes() method doesn't > accept page related attributes. That means users cannot use it to > change page attributes, and have to turn to CPU arch protocol to do it, > which is not be allowed by PI spec. > > From CpuDxe driver perspective, it doesn't update GCD memory attributes > from current page table setup during its initialization. So the memory > attributes in GCD might not reflect all memory attributes in real world. > > Cc: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>> > Cc: Eric Dong <eric.dong@intel.com<mailto:eric.dong@intel.com>> > Cc: Star Zeng <star.zeng@intel.com<mailto:star.zeng@intel.com>> > Cc: Laszlo Ersek <lersek@redhat.com<mailto:lersek@redhat.com>> > Cc: Michael Kinney <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>> > Suggested-by: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>> > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jian J Wang <jian.j.wang@intel.com<mailto:jian.j.wang@intel.com>> > > Jian J Wang (2): > UefiCpuPkg/CpuDxe: Fix out-of-sync issue in CpuDxe > MdeModulePkg/Core: Fix out-of-sync issue in GCD > > MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 45 ++++++++++-------- > UefiCpuPkg/CpuDxe/CpuDxe.c | 5 ++ > UefiCpuPkg/CpuDxe/CpuDxe.h | 9 ++++ > UefiCpuPkg/CpuDxe/CpuPageTable.c | 99 > ++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 140 insertions(+), 18 deletions(-) > > -- > 2.14.1.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org> > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
On Wed, Sep 20, 2017 at 07:53:36AM +0000, Wang, Jian J wrote: > Jiewen, > > Yes. The patch has passed the validation of the UEFI booting Windows 10, Windows 7 and Fedora 25. > > If no comments from you and others, I'll push the patch to upstream soon. > Hi, I think this patch series does not build, while building OVMF we have those errors: GNUmakefile:527: recipe for target '/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC49/X64/UefiCpuPkg/CpuDxe/CpuDxe/OUTPUT/Cp uPageTable.obj' failed make[8]: Leaving directory '/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC49/X64/UefiCpuPkg/CpuDxe/CpuDxe' /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c: In function 'RefreshGcdMemoryAttributesFromPaging': /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:852:10: error: 'DoUpdate' may be used uninitialized in this functio n [-Werror=maybe-uninitialized] if (DoUpdate) { ^ /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:853:9: error: 'Capabilities' may be used uninitialized in this func tion [-Werror=maybe-uninitialized] gDS->SetMemorySpaceCapabilities (BaseAddress, Length, Capabilities); ^ /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:855:90: error: 'Attributes' may be used uninitialized in this funct ion [-Werror=maybe-uninitialized] DEBUG ((DEBUG_INFO, "Update memory space attribute: [%02d] %016lx - %016lx (%08lx -> %08lx)\r\n", ^ cc1: all warnings being treated as errors Full log can be found at: http://logs.test-lab.xenproject.org/osstest/logs/113661/build-amd64/6.ts-xen-build.log Regards, -- Anthony PERARD _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Thanks for catching it. Patch is on the way. -----Original Message----- From: Anthony PERARD [mailto:anthony.perard@citrix.com] Sent: Thursday, September 21, 2017 11:05 PM To: Wang, Jian J <jian.j.wang@intel.com> Cc: Yao, Jiewen <jiewen.yao@intel.com>; edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek <lersek@redhat.com>; Dong, Eric <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com> Subject: Re: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver On Wed, Sep 20, 2017 at 07:53:36AM +0000, Wang, Jian J wrote: > Jiewen, > > Yes. The patch has passed the validation of the UEFI booting Windows 10, Windows 7 and Fedora 25. > > If no comments from you and others, I'll push the patch to upstream soon. > Hi, I think this patch series does not build, while building OVMF we have those errors: GNUmakefile:527: recipe for target '/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC49/X64/UefiCpuPkg/CpuDxe/CpuDxe/OUTPUT/Cp uPageTable.obj' failed make[8]: Leaving directory '/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC49/X64/UefiCpuPkg/CpuDxe/CpuDxe' /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c: In function 'RefreshGcdMemoryAttributesFromPaging': /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:852:10: error: 'DoUpdate' may be used uninitialized in this functio n [-Werror=maybe-uninitialized] if (DoUpdate) { ^ /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:853:9: error: 'Capabilities' may be used uninitialized in this func tion [-Werror=maybe-uninitialized] gDS->SetMemorySpaceCapabilities (BaseAddress, Length, Capabilities); ^ /home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:855:90: error: 'Attributes' may be used uninitialized in this funct ion [-Werror=maybe-uninitialized] DEBUG ((DEBUG_INFO, "Update memory space attribute: [%02d] %016lx - %016lx (%08lx -> %08lx)\r\n", ^ cc1: all warnings being treated as errors Full log can be found at: http://logs.test-lab.xenproject.org/osstest/logs/113661/build-amd64/6.ts-xen-build.log Regards, -- Anthony PERARD _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
© 2016 - 2024 Red Hat, Inc.