From: Vaibhav Jain <vaibhav@linux.ibm.com>
To: Gautam Menghani <gautam@linux.ibm.com>,
npiggin@gmail.com, danielhb413@gmail.com, harshpb@linux.ibm.com,
pbonzini@redhat.com
Cc: Gautam Menghani <gautam@linux.ibm.com>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [PATCH v2] hw/ppc/spapr_hcall: Return host mitigation characteristics in KVM mode
Date: Thu, 11 Sep 2025 15:48:40 +0530 [thread overview]
Message-ID: <87ikhpz3zz.fsf@vajain21.in.ibm.com> (raw)
In-Reply-To: <20250417111907.258723-1-gautam@linux.ibm.com>
Gautam,
Thanks for this patch
Gautam Menghani <gautam@linux.ibm.com> writes:
> Currently, on a P10 KVM guest, the mitigations seen in the output of
> "lscpu" command are different from the host. The reason for this
> behaviour is that when the KVM guest makes the "h_get_cpu_characteristics"
> hcall, QEMU does not consider the data it received from the host via the
> KVM_PPC_GET_CPU_CHAR ioctl, and just uses the values present in
> spapr->eff.caps[], which in turn just contain the default values set in
> spapr_machine_class_init().
>
> Fix this behaviour by making sure that h_get_cpu_characteristics()
> returns the data received from the KVM ioctl for a KVM guest.
>
> Perf impact:
> With null syscall benchmark[1], ~45% improvement is observed.
>
> 1. Vanilla QEMU
> $ ./null_syscall
> 132.19 ns 456.54 cycles
>
> 2. With this patch
> $ ./null_syscall
> 91.18 ns 314.57 cycles
>
> [1]: https://ozlabs.org/~anton/junkcode/null_syscall.c
>
> Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
> ---
<snip>
LGTM,
Reviewed-by: Vaibhav Jain <vaibhav@linux.ibm.com>
--
Cheers
~ Vaibhav
prev parent reply other threads:[~2025-09-11 10:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 11:19 [PATCH v2] hw/ppc/spapr_hcall: Return host mitigation characteristics in KVM mode Gautam Menghani
2025-04-30 11:15 ` Gautam Menghani
2025-06-17 7:16 ` Gautam Menghani
2025-08-19 6:50 ` Gautam Menghani
2025-08-19 6:55 ` Gautam Menghani
2025-09-11 10:18 ` Vaibhav Jain [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=87ikhpz3zz.fsf@vajain21.in.ibm.com \
--to=vaibhav@linux.ibm.com \
--cc=danielhb413@gmail.com \
--cc=gautam@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox