Re: [RFC PATCH] clocksource: hyper-v: Enable the tsc_page for a TDX VM in TD mode

2024-05-28 Thread Tom Lendacky
On 5/24/24 17:44, Michael Kelley wrote: From: Dexuan Cui Sent: Friday, May 24, 2024 1:46 AM From: Dave Hansen Sent: Thursday, May 23, 2024 7:26 AM [...] On 5/22/24 19:24, Dexuan Cui wrote: ... My thoughts: __bss_decrypted is named as if it applies to any CoCo VM, but really it is

Re: [RFC PATCH] clocksource: hyper-v: Enable the tsc_page for a TDX VM in TD mode

2024-05-28 Thread kirill.shute...@linux.intel.com
On Fri, May 24, 2024 at 08:45:42AM +, Dexuan Cui wrote: > > From: Dave Hansen > > Sent: Thursday, May 23, 2024 7:26 AM > > [...] > > On 5/22/24 19:24, Dexuan Cui wrote: > > ... > > > +static bool noinstr intel_cc_platform_td_l2(enum cc_attr attr) > > > +{ > > > + switch (attr) { > > > + case

RE: [RFC PATCH] clocksource: hyper-v: Enable the tsc_page for a TDX VM in TD mode

2024-05-24 Thread Michael Kelley
From: Dexuan Cui Sent: Friday, May 24, 2024 1:46 AM > > > From: Dave Hansen > > Sent: Thursday, May 23, 2024 7:26 AM > > [...] > > On 5/22/24 19:24, Dexuan Cui wrote: > > ... > > > +static bool noinstr intel_cc_platform_td_l2(enum cc_attr attr) > > > +{ > > > + switch (attr) { > > > + case

RE: [RFC PATCH] clocksource: hyper-v: Enable the tsc_page for a TDX VM in TD mode

2024-05-24 Thread Dexuan Cui
> From: Dave Hansen > Sent: Thursday, May 23, 2024 7:26 AM > [...] > On 5/22/24 19:24, Dexuan Cui wrote: > ... > > +static bool noinstr intel_cc_platform_td_l2(enum cc_attr attr) > > +{ > > + switch (attr) { > > + case CC_ATTR_GUEST_MEM_ENCRYPT: > > + case CC_ATTR_MEM_ENCRYPT: > > +

RE: [RFC PATCH] clocksource: hyper-v: Enable the tsc_page for a TDX VM in TD mode

2024-05-24 Thread Dexuan Cui
> From: Kirill A. Shutemov > Sent: Thursday, May 23, 2024 5:06 AM > To: Dexuan Cui > [...] > On Wed, May 22, 2024 at 07:24:41PM -0700, Dexuan Cui wrote: > > A TDX VM on Hyper-V may run in TD mode or Partitioned TD mode (L2). For > > the former, the VM has not enabled the Hyper-V TSC page (which

Re: [RFC PATCH] clocksource: hyper-v: Enable the tsc_page for a TDX VM in TD mode

2024-05-23 Thread Dave Hansen
On 5/22/24 19:24, Dexuan Cui wrote: ... > +static bool noinstr intel_cc_platform_td_l2(enum cc_attr attr) > +{ > + switch (attr) { > + case CC_ATTR_GUEST_MEM_ENCRYPT: > + case CC_ATTR_MEM_ENCRYPT: > + return true; > + default: > + return false; > + } >

Re: [RFC PATCH] clocksource: hyper-v: Enable the tsc_page for a TDX VM in TD mode

2024-05-23 Thread Kirill A. Shutemov
On Wed, May 22, 2024 at 07:24:41PM -0700, Dexuan Cui wrote: > A TDX VM on Hyper-V may run in TD mode or Partitioned TD mode (L2). For > the former, the VM has not enabled the Hyper-V TSC page (which is defined > in drivers/clocksource/hyperv_timer.c: "... tsc_pg __bss_decrypted ...") > because,