All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shah, Amit" <Amit.Shah@amd.com>
To: "Cheatham, Benjamin" <Benjamin.Cheatham@amd.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Moger, Babu" <Babu.Moger@amd.com>
Subject: Re: [PATCH 3/4] target/i386: Add getting RAPSIZE for ERAPS enabled guests
Date: Tue, 30 Jun 2026 16:07:38 +0000	[thread overview]
Message-ID: <90c30873c4bd0c2a8b0da82c6571e17c6272cef3.camel@amd.com> (raw)
In-Reply-To: <20260630153315.1585-4-Benjamin.Cheatham@amd.com>

On Tue, 2026-06-30 at 10:33 -0500, Ben Cheatham wrote:
> From: Amit Shah <amit.shah@amd.com>
> 
> Newer AMD CPUs have the ERAPS (Enhanced Return Address Predictor
> Security) cpuid bit. When this bit is available, the size of the RSB
> is
> indicated in EBX bits 16:23 of the same function. Allow the guest to
> use
> these features when kvm is enabled and are available on the host.
> 
> NOTE: The commit description is from a patch made by Amit while the
> actual changes are a subset of that patch, hence my Co-developed-by.
> Amit, let me know if the attribution looks good to you.

Looks good, thanks.  BTW you can move this blurb below the --- lines so
that it doesn't show up in the commit log.


> Signed-off-by: Amit Shah <amit.shah@amd.com>
> Co-developed-by: Ben Cheatham <Benjamin.Cheatham@amd.com>
> Signed-off-by: Ben Cheatham <Benjamin.Cheatham@amd.com>
> ---
>  target/i386/cpu.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index a85cc67700fa..9342cc3ca4c6 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -9292,7 +9292,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t
> index, uint32_t count,
>      case 0x80000021:
>          *eax = *ebx = *ecx = *edx = 0;
>          *eax = env->features[FEAT_8000_0021_EAX];
> -        *ebx = env->features[FEAT_8000_0021_EBX];
> +
> +        if (kvm_enabled() && (*eax & CPUID_8000_0021_EAX_ERAPS)) {
> +            *ebx |=
> +              kvm_arch_get_supported_cpuid(cs->kvm_state, index,
> count, R_EBX) &
> +              CPUID_8000_0021_EBX_RAPSIZE;
> +        }
> +
>          *ecx = env->features[FEAT_8000_0021_ECX];
>          break;
>      case 0x80000022:

  reply	other threads:[~2026-06-30 17:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 15:33 [PATCH 0/4] Add Support for AMD EPYC Zen 6 CPU Model Ben Cheatham
2026-06-30 15:33 ` [PATCH 1/4] target/i386: Add AVX512 Bit Matrix Multiply (BMM) support Ben Cheatham
2026-06-30 15:33 ` [PATCH 2/4] target/i386: Update RAPSIZE definition Ben Cheatham
2026-06-30 15:33 ` [PATCH 3/4] target/i386: Add getting RAPSIZE for ERAPS enabled guests Ben Cheatham
2026-06-30 16:07   ` Shah, Amit [this message]
2026-06-30 16:38     ` Cheatham, Benjamin
2026-06-30 15:33 ` [PATCH 4/4] target/i386: Add EPYC-Venice CPU model Ben Cheatham

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=90c30873c4bd0c2a8b0da82c6571e17c6272cef3.camel@amd.com \
    --to=amit.shah@amd.com \
    --cc=Babu.Moger@amd.com \
    --cc=Benjamin.Cheatham@amd.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.