Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-22 Thread Jeremi Piotrowski
On 10/11/2023 19:57, kirill.shute...@linux.intel.com wrote: > On Fri, Nov 10, 2023 at 02:42:31PM +0100, Jeremi Piotrowski wrote: >> On 10/11/2023 13:46, kirill.shute...@linux.intel.com wrote: >>> On Fri, Nov 10, 2023 at 01:27:08PM +0100, Jeremi Piotrowski wrote: > Maybe just remove incorrect in

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-22 Thread Jeremi Piotrowski
On 10/11/2023 17:45, Borislav Petkov wrote: > On Fri, Nov 10, 2023 at 04:51:43PM +0100, Jeremi Piotrowski wrote: >> What's semi-correct about checking for CC_VENDOR_INTEL and then >> printing Intel? I can post a v2 that checks CC_ATTR_GUEST_MEM_ENCRYPT >> before printing "TDX". > > How is it that

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread kirill . shutemov
On Fri, Nov 10, 2023 at 02:42:31PM +0100, Jeremi Piotrowski wrote: > On 10/11/2023 13:46, kirill.shute...@linux.intel.com wrote: > > On Fri, Nov 10, 2023 at 01:27:08PM +0100, Jeremi Piotrowski wrote: > >>> Maybe just remove incorrect info and that's it? > >>> > >> > >> I disagree, other users and I

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread Borislav Petkov
On Fri, Nov 10, 2023 at 04:51:43PM +0100, Jeremi Piotrowski wrote: > What's semi-correct about checking for CC_VENDOR_INTEL and then > printing Intel? I can post a v2 that checks CC_ATTR_GUEST_MEM_ENCRYPT > before printing "TDX". How is it that you're not seeing the conflict: Your TD partitionin

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread Jeremi Piotrowski
On 10/11/2023 14:17, Borislav Petkov wrote: > On Thu, Nov 09, 2023 at 07:41:33PM +0100, Jeremi Piotrowski wrote: >> tdx_early_init() changes kernel behavior with the assumption that it >> can talk directly to the TD module or change page visibility in >> a certain way, instead of talking to a parav

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread Jeremi Piotrowski
On 10/11/2023 13:46, kirill.shute...@linux.intel.com wrote: > On Fri, Nov 10, 2023 at 01:27:08PM +0100, Jeremi Piotrowski wrote: >>> Maybe just remove incorrect info and that's it? >>> >> >> I disagree, other users and I find the print very useful to see which coco >> platform the kernel is running

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread Borislav Petkov
On Thu, Nov 09, 2023 at 07:41:33PM +0100, Jeremi Piotrowski wrote: > tdx_early_init() changes kernel behavior with the assumption that it > can talk directly to the TD module or change page visibility in > a certain way, instead of talking to a paravisor. So that CPUID is > hidden to prevent this.

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread kirill . shutemov
On Fri, Nov 10, 2023 at 01:27:08PM +0100, Jeremi Piotrowski wrote: > > Maybe just remove incorrect info and that's it? > > > > I disagree, other users and I find the print very useful to see which coco > platform the kernel is running on and which confidential computing features > the kernel dete

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread Jeremi Piotrowski
On 10/11/2023 13:06, kirill.shute...@linux.intel.com wrote: > On Thu, Nov 09, 2023 at 07:41:33PM +0100, Jeremi Piotrowski wrote: >> It's not disregard, the way the kernel behaves in this case is correct except >> for the error in reporting CPU vendor. Users care about seeing the correct >> informat

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-10 Thread kirill . shutemov
On Thu, Nov 09, 2023 at 07:41:33PM +0100, Jeremi Piotrowski wrote: > It's not disregard, the way the kernel behaves in this case is correct except > for the error in reporting CPU vendor. Users care about seeing the correct > information in dmesg. I think it is wrong place to advertise CoCo featur

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-09 Thread Jeremi Piotrowski
On 09/11/2023 17:50, Dave Hansen wrote: > On 11/9/23 08:35, Jeremi Piotrowski wrote: >> On 09/11/2023 17:25, Dave Hansen wrote: >>> On 11/9/23 08:14, Jeremi Piotrowski wrote: >>> ... pr_info("Memory Encryption Features active:"); - if (cpu_feature_enabled(X86_FEATURE_TDX_GUEST)

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-09 Thread Dave Hansen
On 11/9/23 08:35, Jeremi Piotrowski wrote: > On 09/11/2023 17:25, Dave Hansen wrote: >> On 11/9/23 08:14, Jeremi Piotrowski wrote: >> ... >>> pr_info("Memory Encryption Features active:"); >>> >>> - if (cpu_feature_enabled(X86_FEATURE_TDX_GUEST)) { >>> + if (cc_vendor == CC_VENDOR_INTEL)

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-09 Thread Jeremi Piotrowski
On 09/11/2023 17:25, Dave Hansen wrote: > On 11/9/23 08:14, Jeremi Piotrowski wrote: > ... >> pr_info("Memory Encryption Features active:"); >> >> -if (cpu_feature_enabled(X86_FEATURE_TDX_GUEST)) { >> +if (cc_vendor == CC_VENDOR_INTEL) { >> pr_cont(" Intel TDX\n"); >>

Re: [PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-09 Thread Dave Hansen
On 11/9/23 08:14, Jeremi Piotrowski wrote: ... > pr_info("Memory Encryption Features active:"); > > - if (cpu_feature_enabled(X86_FEATURE_TDX_GUEST)) { > + if (cc_vendor == CC_VENDOR_INTEL) { > pr_cont(" Intel TDX\n"); > return; > } Why aren't thes

[PATCH] x86/mm: Check cc_vendor when printing memory encryption info

2023-11-09 Thread Jeremi Piotrowski
Check the value of cc_vendor to see if we're in an Intel TDX protected VM instead of checking for the TDX_GUEST CPU feature. The rest of the function already uses the abstractions available in cc_platform.h to check for confidential computing features. For Intel, cc_vendor is set from tdx_early_ini