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: <e657e1ed-d86e-f033-151a-21057b979f9f@intel.com>
Date:   Tue, 18 May 2021 09:22:40 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     Andi Kleen <ak@...ux.intel.com>,
        Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andy Lutomirski <luto@...nel.org>
Cc:     Tony Luck <tony.luck@...el.com>,
        Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
        Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Raj Ashok <ashok.raj@...el.com>,
        Sean Christopherson <seanjc@...gle.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC v2-fix 1/1] x86/tdx: Handle in-kernel MMIO

On 5/18/21 9:10 AM, Andi Kleen wrote:
> I'm not aware of any other places that would do MMIO without using the
> standard io.h macros, although it might happen in theory on x86 (but
> would likely break on some other architectures)

Can we please connect all of the dots and turn this into a coherent
changelog?

 * In-kernel MMIO is handled via exceptions (#VE) and instruction
   cracking
 * Arbitrary MMIO instructions are not handled (and would result in...)
 * The limited set of MMIO instructions that are handled are known and
   come from the io.h macros, ultimately build_mmio_read/write().
 * This approach is also used for SEV-ES???
 * Some x86 code that avoids the MMIO code is known to exist (APIC).
   But, this code is not used in TDX guests

BTW, in perusing arch/x86/include/asm/io.h, I was reminded of movdir64b.
 That seems like one we'd want to take care of sooner rather than later.
 Or, do we expect the first folks who expose a movdir64b-using driver to
TDX to go and update this code?

Also, the sev_key_active() stuff in there makes me nervous.  Does this
scheme work with these:

> static inline void outs##bwl(int port, const void *addr, unsigned long count) \
> static inline void ins##bwl(int port, void *addr, unsigned long count)  \

?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ