[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8fb0e52c-ed0a-2185-585a-27007c27ed56@linux.intel.com>
Date: Tue, 18 May 2021 10:21:47 -0700
From: Andi Kleen <ak@...ux.intel.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Dave Hansen <dave.hansen@...el.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
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>, linux-kernel@...r.kernel.org
Subject: Re: [RFC v2-fix 1/1] x86/tdx: Handle in-kernel MMIO
> The extra bytes for .altinstructions is very different than the extra bytes for
> the code itself. The .altinstructions section is freed after init, so yes it
> bloats the kernel size a bit, but the runtime footprint is unaffected by the
> patching metadata.
>
> IIRC, patching read/write{b,w,l,q}() can be done with 3 bytes of .text overhead.
>
> The other option to explore is to hook/patch IO_COND(), which can be done with
> neglible overhead because the helpers that use IO_COND() are not inlined. In a
> TDX guest, redirecting IO_COND() to a paravirt helper would likely cover the
> majority of IO/MMIO since virtio-pci exclusively uses the IO_COND() wrappers.
> And if there are TDX VMMs that want to deploy virtio-mmio, hooking
> drivers/virtio/virtio_mmio.c directly would be a viable option.
Yes but what's the point of all that?
Even if it's only 3 bytes we still have a lot of MMIO all over the
kernel which never needs it.
And I don't even see what TDX (or SEV which already does the decoding
and has been merged) would get out of it. We handle all the #VEs just
fine. And the instruction handling code is fairly straight forward too.
Besides instruction decoding works fine for all the existing
hypervisors. All we really want to do is to do the same thing as KVM
would do.
-Andi
Powered by blists - more mailing lists