From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
alexander.shishkin@linux.intel.com
Subject: Re: [PATCH] x86/sev: Move sev_setup_arch() to mem_encrypt.c
Date: Fri, 09 Jun 2023 20:19:43 +0300 [thread overview]
Message-ID: <873530zh74.fsf@ubik.fi.intel.com> (raw)
In-Reply-To: <ZHZGkulyli8MvXRR@aschofie-mobl2>
Alison Schofield <alison.schofield@intel.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
prev parent reply other threads:[~2023-06-09 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 12:17 [PATCH] x86/sev: Move sev_setup_arch() to mem_encrypt.c Alexander Shishkin
2023-05-30 18:55 ` Alison Schofield
2023-06-09 17:19 ` Alexander Shishkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873530zh74.fsf@ubik.fi.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=alison.schofield@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox