Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-24 Thread Gerd Hoffmann
Hi, > > static u8 vmx_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio) > > { > > [ ... ] > > * When there is no need to deal with noncoherent DMA (e.g., no VT-d > > * or VT-d has snoop control), guest CD/MTRR/PAT are all ignored. > > The > > * EPT memory

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-24 Thread Laszlo Ersek
On 1/24/24 14:26, Gerd Hoffmann wrote: > Hi, > >> So, yesterday I read your status on virt-staff, and I found an entry in >> it that resembled this upstream thread pretty closely. However, your >> status was the *only* mention of "mdev" specifically, and so I wasn't >> sure if *mdev* meant the

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-24 Thread Gerd Hoffmann
Hi, > So, yesterday I read your status on virt-staff, and I found an entry in > it that resembled this upstream thread pretty closely. However, your > status was the *only* mention of "mdev" specifically, and so I wasn't > sure if *mdev* meant the same thing as the more generic upstream >

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-24 Thread Laszlo Ersek
On 1/23/24 17:11, Gerd Hoffmann wrote: > Hi, > > Well, it's OVMF in a virtual machine. No boot guard involved. > So we could probably go for a OVMF-specific patch here. > > But I'd prefer to figure what exactly is happening here before going > down that route. An extreme

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-23 Thread Min Xu
Add intel linux guys in CC list. > -Original Message- > From: Gerd Hoffmann > Sent: Wednesday, January 24, 2024 12:12 AM > To: Laszlo Ersek > Cc: devel@edk2.groups.io; Johnson, Brian ; West, > Catharine ; Xu, Min M ; Ni, > Ray ; Wu, MingliangX ; Yao, > Jiewen ; Xue, Shengfeng > ; Dong,

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-23 Thread Gerd Hoffmann
Hi, > >>> Well, it's OVMF in a virtual machine. No boot guard involved. > >>> So we could probably go for a OVMF-specific patch here. > >>> > >>> But I'd prefer to figure what exactly is happening here before going > >>> down that route. An extreme slowdown just because we flip that bit > >>>

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-23 Thread Laszlo Ersek
On 1/23/24 11:52, Gerd Hoffmann wrote: > On Mon, Jan 22, 2024 at 01:11:52PM -0600, Brian J. Johnson wrote: >> On 1/18/24 09:46, Gerd Hoffmann wrote: >>> On Wed, Jan 10, 2024 at 04:43:47PM +, West, Catharine wrote: Disabling cache by default results in violation of BTG protections (if BTG

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-23 Thread Gerd Hoffmann
On Mon, Jan 22, 2024 at 01:11:52PM -0600, Brian J. Johnson wrote: > On 1/18/24 09:46, Gerd Hoffmann wrote: > > On Wed, Jan 10, 2024 at 04:43:47PM +, West, Catharine wrote: > > > Disabling cache by default results in violation of BTG protections (if > > > BTG enabled). > > > BIOS cannot assume

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-22 Thread Min Xu
Thanks much Johnson! We will investigate it based on your comments. > -Original Message- > From: Brian J. Johnson > Sent: Tuesday, January 23, 2024 3:12 AM > To: devel@edk2.groups.io; kra...@redhat.com; West, Catharine > > Cc: Xu, Min M ; Ni, Ray ; Wu, > MingliangX ; Yao, Jiewen > ;

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-22 Thread Brian J. Johnson
On 1/18/24 09:46, Gerd Hoffmann wrote: On Wed, Jan 10, 2024 at 04:43:47PM +, West, Catharine wrote: Disabling cache by default results in violation of BTG protections (if BTG enabled). BIOS cannot assume that cache is disabled before it executes as ACM may be required to enable NEM.

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-18 Thread Gerd Hoffmann
On Wed, Jan 10, 2024 at 04:43:47PM +, West, Catharine wrote: > Disabling cache by default results in violation of BTG protections (if BTG > enabled). > > BIOS cannot assume that cache is disabled before it executes as ACM may be > required to enable NEM. > > Whatever solution needs to be

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-10 Thread West, Catharine
Disabling cache by default results in violation of BTG protections (if BTG enabled). BIOS cannot assume that cache is disabled before it executes as ACM may be required to enable NEM. Whatever solution needs to be done here cannot evict ACM-enabled NEM. Why is boot time increasing? In this

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-09 Thread Min Xu
This patch causes a regression when launching a vm guest with below command: $ /usr/libexec/qemu-kvm \ -name guestVM1 -machine q35 -accel kvm -m 10240 -smp 8 -cpu host -monitor pty \ -drive format=raw,file=/home/tdvf/centos-stream-9.img \ -bios /home/tdvf/OVMF.fd \ -nic

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2023-08-03 Thread Ni, Ray
The patch resolves an issue in Boot Guard enabled system that NEM is already enabled by Boot Guard, disabling cache evicts all cache content which is unexpected. Reviewed-by: Ray Ni > -Original Message- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Wednesday, July 26,

[edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2023-07-27 Thread xueshengfeng via groups.io
From: "Wu, MingliangX" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4511 With 64 bit build we are seeing the CD in control register CR 0 set. This causes the NEM to disabled for some specific bios profiles. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Debkumar De

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2023-07-26 Thread Ni, Ray
This patch is not right. Intel SDM explicitly says the initial CR0 value is 6000_0010. CD bit is set. So the ResetVector code that still sets CD bit should be good. If you are facing NEM enable failure, can you change your NEM enable logic to explicitly clear CD bit instead of changing here?