Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-20 Thread Laszlo Ersek
On 02/19/19 20:51, Andrew Fish wrote: > > >> On Feb 18, 2019, at 5:23 AM, Laszlo Ersek wrote: >> >> generic comment (applies to all NASM usage I guess): >> >> On 02/18/19 11:10, Jordan Justen wrote: >> >>> +mov eax, cr0 >>> +and eax, ~(1 << 30) >>> +mov cr0, eax >> >>> +

Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-20 Thread Laszlo Ersek
On 02/19/19 20:59, Jordan Justen wrote: > On 2019-02-18 05:23:28, Laszlo Ersek wrote: >> generic comment (applies to all NASM usage I guess): >> >> On 02/18/19 11:10, Jordan Justen wrote: >> >>> +mov eax, cr0 >>> +and eax, ~(1 << 30) >>> +mov cr0, eax >> >>> +mov rax

Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-20 Thread Laszlo Ersek
On 02/20/19 03:43, Fang, Peter wrote: > When CR0.CD is set, KVM *might* emulate it by setting MTRR_TYPE_UNCACHABLE in > its EPTE if non-coherent DMA is detected, because VT-d does not provide > snooping in this case. I think this was precisely the use case that I had to tweak with Linux commit 8

Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-19 Thread Jordan Justen
On 2019-02-18 05:23:28, Laszlo Ersek wrote: > generic comment (applies to all NASM usage I guess): > > On 02/18/19 11:10, Jordan Justen wrote: > > > +mov eax, cr0 > > +and eax, ~(1 << 30) > > +mov cr0, eax > > > +mov rax, cr0 > > +and eax, ~(1 << 30) > > +

Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-19 Thread Andrew Fish via edk2-devel
> On Feb 18, 2019, at 5:23 AM, Laszlo Ersek wrote: > > generic comment (applies to all NASM usage I guess): > > On 02/18/19 11:10, Jordan Justen wrote: > >> +mov eax, cr0 >> +and eax, ~(1 << 30) >> +mov cr0, eax > >> +mov rax, cr0 >> +and eax, ~(1 <<

Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-19 Thread Jordan Justen
On 2019-02-18 04:17:26, Laszlo Ersek wrote: > On 02/18/19 11:10, Jordan Justen wrote: > > Clear the CD (Cache Disable) flag in the CR0 register. When the VM > > implements the CD flag, this can substantially decrease the time it > > takes to decompress the firmware volumes. > > > > Contributed-und

Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-18 Thread Laszlo Ersek
generic comment (applies to all NASM usage I guess): On 02/18/19 11:10, Jordan Justen wrote: > +mov eax, cr0 > +and eax, ~(1 << 30) > +mov cr0, eax > +mov rax, cr0 > +and eax, ~(1 << 30) > +mov cr0, rax I've read up on the << and ~ operators in th

Re: [edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-18 Thread Laszlo Ersek
On 02/18/19 11:10, Jordan Justen wrote: > Clear the CD (Cache Disable) flag in the CR0 register. When the VM > implements the CD flag, this can substantially decrease the time it > takes to decompress the firmware volumes. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by

[edk2] [PATCH] OvmfPkg/Sec: Clear the Cache Disable flag in the CR0 register

2019-02-18 Thread Jordan Justen
Clear the CD (Cache Disable) flag in the CR0 register. When the VM implements the CD flag, this can substantially decrease the time it takes to decompress the firmware volumes. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jordan Justen Tested-by: Peter Fang Cc: Peter Fa