[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <873530zh74.fsf@ubik.fi.intel.com>
Date: Fri, 09 Jun 2023 20:19:43 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Alison Schofield <alison.schofield@...el.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
alexander.shishkin@...ux.intel.com
Subject: Re: [PATCH] x86/sev: Move sev_setup_arch() to mem_encrypt.c
Alison Schofield <alison.schofield@...el.com> writes:
> On Tue, May 30, 2023 at 03:17:28PM +0300, Alexander Shishkin wrote:
>> Since commit 4d96f9109109b ("x86/sev: Replace occurrences of
>> sev_active() with cc_platform_has()"), the SWIOTLB bounce buffer size
>> adjustment and restricted virtio memory setting also inadvertently apply
>> to TDX, which just happens to be what we want.
>
> Hi Alexander,
Hi Alison,
> Can you offer more context on how this inadvertently applies?
Yes, the code uses cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) condition
for setting the bounce buffer size and enabling restricted virtio
memory, which is also true for TDX. I've added a bit about this to v2
[0].
> One bit below...
>> --- a/arch/x86/mm/mem_encrypt.c
>> +++ b/arch/x86/mm/mem_encrypt.c
>> @@ -12,6 +12,7 @@
>> #include <linux/swiotlb.h>
>> #include <linux/cc_platform.h>
>> #include <linux/mem_encrypt.h>
>> +#include <linux/virtio_anchor.h>
>
> It looks like this #include can be removed from mem_encrypt_amd.c
Good catch! This is also addressed in v2.
[0] https://lore.kernel.org/lkml/20230609171214.31846-1-alexander.shishkin@linux.intel.com/
Thanks,
--
Alex
Powered by blists - more mailing lists