lkml.org 
[lkml]   [2023]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v12 07/22] x86/virt/tdx: Add skeleton to enable TDX on demand
Date
On Tue, 2023-06-27 at 22:37 +0000, Huang, Kai wrote:
> > >
> > > +/*
> > > + * Do the module global initialization if not done yet.
> > > + * It's always called with interrupts and preemption disabled.
> > > + */
> >
> > If interrupts are always disabled why do you need _irqsave()?
> >
>
> I'll remove the _irqsave().
>
> AFAICT Isaku preferred this for additional security, but this is not
> necessary.
>
>

Damn. I think we can change the comment to say this function is called with
preemption being disabled, but _can_ be called with interrupt disabled. And we
keep using the _irqsave() version.

/*
* Do the module global initialization if not done yet. It's always
* called with preemption disabled and can be called with interrupts
* disabled.
*/

This allows a use case that the caller simply wants to call some SEAMCALL on
local cpu, e.g., IOMMU code may just use below to get some TDX-IO information:

preempt_disable();
vmxon();
tdx_cpu_enable();
SEAMCALL;
vmxoff();
preempt_enable();

Are you OK with this?
\
 
 \ /
  Last update: 2023-06-28 02:29    [W:0.912 / U:1.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site