lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 05/10] x86/tdx: Handle port I/O
From
Date
On 10/17/21 3:35 PM, Sathyanarayanan Kuppuswamy wrote:
>
> 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?

Either way works for me.

For the cc_platform_has() path, you will need to update the
amd_cc_platform_has() to return true for CC_ATTR_GUEST_UNROLL_STRING_IO
for SEV only, i.e.:

case CC_ATTR_GUEST_UNROLL_STRING_IO:
return (sev_status & MSR_AMD64_SEV_ENABLED) &&
!(sev_status & MSR_AMD64_SEV_ES_ENABLED);

Thanks,
Tom

\
 
 \ /
  Last update: 2021-10-18 15:55    [W:0.316 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site