lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f66eec4b-fa80-fdce-9b9f-12ff6a3f4a6d@linux.intel.com>
Date:   Mon, 18 Oct 2021 11:42:07 -0700
From:   Sathyanarayanan Kuppuswamy 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>
To:     Tom Lendacky <thomas.lendacky@....com>,
        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>
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/18/21 6:52 AM, Tom Lendacky wrote:
> 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);

I will submit a separate cleanup patch to make SEV code use 
CC_ATTR_GUEST_UNROLL_STRING_IO
first. That way, in this patch I can just set 
CC_ATTR_GUEST_UNROLL_STRING_IO.

>
> Thanks,
> Tom

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ