[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eadc3025-a32d-3641-de83-e5f05728a755@linux.intel.com>
Date: Sun, 17 Oct 2021 13:35:23 -0700
From: Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, Paolo Bonzini <pbonzini@...hat.com>,
David Hildenbrand <david@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
"H . Peter Anvin" <hpa@...or.com>, thomas.lendacky@....com
Cc: Dave Hansen <dave.hansen@...el.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 v7 05/10] x86/tdx: Handle port I/O
On 10/17/21 12:58 PM, Thomas Gleixner wrote:
> On Tue, Oct 05 2021 at 13:41, Kuppuswamy Sathyanarayanan wrote:
>> \
>> static inline void outs##bwl(int port, const void *addr, unsigned long count) \
>> { \
>> - if (sev_key_active()) { \
>> + if (sev_key_active() || \
>> + cc_platform_has(CC_ATTR_GUEST_UNROLL_STRING_IO)) { \
> Instead of adding an extra check, can you please replace that
> sev_key_active() with cc_platform_has() completely?
Yes. sev_key_active() can be removed and replaced with
cc_platform_has().
Thomas Lendacky also proposed to introduce as common
static key which can be set by both AMD SEV and TDX code.
@Thomas Lendacky, any comments?
>
>> +/*
>> + * tdx_handle_early_io() cannot be re-used in #VE handler for handling
>> + * I/O because the way of handling string I/O is different between
>> + * normal and early I/O case. Also, once trace support is enabled,
>> + * tdx_handle_io() will be extended to use trace calls which is also
>> + * not valid for early I/O cases.
>> + */
>> +static void tdx_handle_io(struct pt_regs *regs, u32 exit_qual)
>> +{
>> + struct tdx_hypercall_output outh;
>> + int out, size, port, ret;
>> + bool string;
>> + u64 mask;
>> +
>> + string = VE_IS_IO_STRING(exit_qual);
>> +
>> + /* I/O strings ops are unrolled at build time. */
> Fancy. The compiler can evaluate sev_key_active() and
> cc_platform_has() at build time?
It is incorrect. I will fix this in next version. How about following
change?
I/O strings are replaced with in/out instructions. If string is reported,
report it with BUG.
>
> Thanks,
>
> tglx
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
Powered by blists - more mailing lists