[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3afaebee-77dc-83ff-c397-aa64991c52be@linux.intel.com>
Date: Tue, 8 Jun 2021 11:12:48 -0700
From: Andi Kleen <ak@...ux.intel.com>
To: Dave Hansen <dave.hansen@...el.com>,
Sean Christopherson <seanjc@...gle.com>
Cc: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Tony Luck <tony.luck@...el.com>,
Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
Raj Ashok <ashok.raj@...el.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC v2 08/32] x86/traps: Add #VE support for TDX guest
On 6/8/2021 10:53 AM, Dave Hansen wrote:
> On 6/8/21 10:48 AM, Sean Christopherson wrote:
>> On Tue, Jun 08, 2021, Dave Hansen wrote:
>>> On 4/26/21 11:01 AM, Kuppuswamy Sathyanarayanan wrote:
>>>> +#ifdef CONFIG_INTEL_TDX_GUEST
>>>> +DEFINE_IDTENTRY(exc_virtualization_exception)
>>>> +{
>>>> + struct ve_info ve;
>>>> + int ret;
>>>> +
>>>> + RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
>>>> +
>>>> + /*
>>>> + * Consume #VE info before re-enabling interrupts. It will be
>>>> + * re-enabled after executing the TDGETVEINFO TDCALL.
>>>> + */
>>>> + ret = tdg_get_ve_info(&ve);
>>> Is it safe to have *anything* before the tdg_get_ve_info()? For
>>> instance, say that RCU_LOCKDEP_WARN() triggers. Will anything in there
>>> do MMIO?
>> I doubt it's safe, anything that's doing printing has the potential to trigger
>> #VE. Even if we can prove it's safe for all possible paths, I can't think of a
>> reason to allow anything that's not absolutely necessary before retrieving the
>> #VE info.
> What about tracing? Can I plop a kprobe in here or turn on ftrace?
I believe neither does mmio/msr normally (except maybe ftrace+tp_printk,
but that will likely work because it shouldn't recurse more than once
due to ftrace's reentry protection)
-Andi
Powered by blists - more mailing lists