mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"H. Peter Anvin" <hpa@zytor.com>, Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH] x86/sev-es: Do not unroll string I/O for SEV-ES guests
Date: Mon, 1 Feb 2021 12:34:31 -0600	[thread overview]
Message-ID: <76141611-c8a5-312c-24f8-b47720836054@amd.com> (raw)
In-Reply-To: <3de04b5b638546ac75d42ba52307fe1a922173d3.1612203987.git.thomas.lendacky@amd.com>

On 2/1/21 12:26 PM, Tom Lendacky wrote:
> From: Tom Lendacky <thomas.lendacky@amd.com>
> 
> Under the GHCB specification, SEV-ES guests can support string I/O. The
> current #VC handler contains this support, so remove the need to unroll
> kernel string I/O operations. This will reduce the number of #VC
> exceptions generated as well as the number VMEXITS for the guest.
> 
> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
>   arch/x86/mm/mem_encrypt.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
> index c79e5736ab2b..d55ea77e1ca8 100644
> --- a/arch/x86/mm/mem_encrypt.c
> +++ b/arch/x86/mm/mem_encrypt.c
> @@ -474,9 +474,10 @@ void __init mem_encrypt_init(void)
>   	swiotlb_update_mem_attributes();
>   
>   	/*
> -	 * With SEV, we need to unroll the rep string I/O instructions.
> +	 * With SEV, we need to unroll the rep string I/O instructions,
> +	 * but SEV-ES supports them through the #VC handler.
>   	 */
> -	if (sev_active())
> +	if (sev_active() && !sev_es_active())
>   		static_branch_enable(&sev_enable_key);

This brings up a question. The name implies that this is a general SEV 
related key. However, it's currently only used for the string I/O 
operations. If further usage of this key is added in the future, then this 
would probably need to be split into two keys, the sev_enable_key and an 
sev_unroll_io_key.

Is it worth documenting that in the comment? Or should the key be renamed now?

Thanks,
Tom

>   
>   	print_mem_encrypt_feature_info();
> 
> base-commit: a7e0bdf1b07ea6169930ec42b0bdb17e1c1e3bb0
> 

      reply	other threads:[~2021-02-01 18:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 18:26 Tom Lendacky
2021-02-01 18:34 ` Tom Lendacky [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=76141611-c8a5-312c-24f8-b47720836054@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jroedel@suse.de \
    --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

all inboxes | Powered by JetHome®