[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b7f13b9-6d32-c97c-aaea-4e256a59f90b@intel.com>
Date: Sun, 17 Oct 2021 10:15:22 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Borislav Petkov <bp@...en8.de>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
Paolo Bonzini <pbonzini@...hat.com>,
David Hildenbrand <david@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Juergen Gross <jgross@...e.com>, Deep Shah <sdeep@...are.com>,
VMware Inc <pv-drivers@...are.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, Peter H Anvin <hpa@...or.com>,
Tony Luck <tony.luck@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
Sean Christopherson <seanjc@...gle.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 06/11] x86/traps: Add #VE support for TDX guest
On 10/7/21 10:06 AM, Borislav Petkov wrote:
> On Mon, Oct 04, 2021 at 07:52:00PM -0700, Kuppuswamy Sathyanarayanan wrote:
>> +unsigned long tdx_get_ve_info(struct ve_info *ve)
>> +{
>> + struct tdx_module_output out = {0};
>> + u64 ret;
>> +
>> + /*
>> + * NMIs and machine checks are suppressed. Before this point any
>> + * #VE is fatal. After this point (TDGETVEINFO call), NMIs and
>> + * additional #VEs are permitted (but it is expected not to
>> + * happen unless kernel panics).
>> + */
>> + ret = __tdx_module_call(TDGETVEINFO, 0, 0, 0, 0, &out);
> Same question as before - why do you need to clear this @out thing above
> when __tdx_module_call() will overwrite it?
>
> What you should do instead is check that @ve pointer which you get
> passed in - it might be NULL.
Hi Borislav,
That ve_info really is specific to handling a fault. There's only one
call site:
> +DEFINE_IDTENTRY(exc_virtualization_exception)
> +{
> + struct ve_info ve;
...
> + ret = tdx_get_ve_info(&ve);
I think it's equivalent to something like a 'pt_regs' or 'stack_info'
that we pass around in other exception handlers. It's always stack
allocated. It's never dynamically allocated and NULL is never passed
for some other semantic reason.
Powered by blists - more mailing lists