lkml.org 
[lkml]   [2021]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7 2/6] x86/boot: Avoid #VE during boot for TDX platforms
Date
On Tue, Oct 05 2021 at 16:05, Kuppuswamy Sathyanarayanan wrote:
>
> /* Enable PAE and LA57 (if required) paging modes */
> - movl $X86_CR4_PAE, %eax
> + movl %cr4, %eax
> + /*
> + * Clear all bits except CR4.MCE, which is preserved.
> + * Clearing CR4.MCE will #VE in TDX guests.

Sure. But what's the side effect for non TDX?

> + */
> + andl $X86_CR4_MCE, %eax
> + orl $X86_CR4_PAE, %eax
> testl %edx, %edx
> jz 1f
> orl $X86_CR4_LA57, %eax
> @@ -662,8 +670,8 @@ SYM_CODE_START(trampoline_32bit_src)
> pushl $__KERNEL_CS
> pushl %eax
>
> - /* Enable paging again */
> - movl $(X86_CR0_PG | X86_CR0_PE), %eax
> + /* Enable paging again. Avoid clearing X86_CR0_NE for TDX */

Ditto.

The changelog is not providing any information either.

Also instead of '... TDX' all over the place please add sensible defines
and add comments to those in one place. There is really no need to
sprinkle TDX all over the place.

Thanks,

tglx

\
 
 \ /
  Last update: 2021-10-17 21:50    [W:0.207 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site