From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>, qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org, Harsh Prateek Bora <harshpb@linux.ibm.com>
Subject: Re: [PATCH v4] target/ppc: Add POWER9 DD2.2 model
Date: Tue, 16 May 2023 14:53:41 +0530 [thread overview]
Message-ID: <f9167007-ca18-eef6-5973-64da0ff4fedc@linux.ibm.com> (raw)
In-Reply-To: <20230515160201.394587-1-npiggin@gmail.com>
<correcting my email in CC>
On 5/15/23 21:32, Nicholas Piggin wrote:
> POWER9 DD2.1 and earlier had significant limitations when running KVM,
> including lack of "mixed mode" MMU support (ability to run HPT and RPT
> mode on threads of the same core), and a translation prefetch issue
> which is worked around by disabling "AIL" mode for the guest.
>
> These processors are not widely available, and it's difficult to deal
> with all these quirks in qemu +/- KVM, so create a POWER9 DD2.2 CPU
> and make it the default POWER9 CPU.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> This is unchanged since v3, just reposting.
>
> Thanks,
> Nick
>
> hw/ppc/pnv.c | 2 +-
> hw/ppc/pnv_core.c | 2 +-
> hw/ppc/spapr.c | 2 +-
> hw/ppc/spapr_cpu_core.c | 1 +
> include/hw/ppc/pnv.h | 2 +-
> target/ppc/cpu-models.c | 4 +++-
> target/ppc/cpu-models.h | 1 +
> target/ppc/cpu_init.c | 21 +++++++++++++++++++--
> tests/qtest/device-plug-test.c | 4 ++--
> 9 files changed, 30 insertions(+), 9 deletions(-)
>
<snip>
> diff --git a/target/ppc/cpu-models.h b/target/ppc/cpu-models.h
> index a77e036b3a..572b5e553a 100644
> --- a/target/ppc/cpu-models.h
> +++ b/target/ppc/cpu-models.h
> @@ -350,6 +350,7 @@ enum {
> CPU_POWERPC_POWER9_BASE = 0x004E0000,
> CPU_POWERPC_POWER9_DD1 = 0x004E1100,
> CPU_POWERPC_POWER9_DD20 = 0x004E1200,
> + CPU_POWERPC_POWER9_DD22 = 0x004E1202,
> CPU_POWERPC_POWER10_BASE = 0x00800000,
> CPU_POWERPC_POWER10_DD1 = 0x00801100,
> CPU_POWERPC_POWER10_DD20 = 0x00801200,
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 0ce2e3c91d..6775828dfc 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -6284,9 +6284,26 @@ static bool ppc_pvr_match_power9(PowerPCCPUClass *pcc, uint32_t pvr, bool best)
> return false;
> }
>
> - if ((pvr & 0x0f00) == (pcc->pvr & 0x0f00)) {
> - /* Major DD version matches to power9_v1.0 and power9_v2.0 */
> + if ((pvr & 0x0f00) != (pcc->pvr & 0x0f00)) {
> + /* Major DD version does not match */
> + return false;
> + }
> +
> + if ((pvr & 0x0f00) == 0x100) {
> + /* DD1.x always matches power9_v1.0 */
> return true;
> + } else if ((pvr & 0x0f00) == 0x200) {
> + if ((pvr & 0xf) < 2) {
> + /* DD2.0, DD2.1 match power9_v2.0 */
> + if ((pcc->pvr & 0xf) == 0) {
> + return true;
> + }
> + } else {
> + /* DD2.2, DD2.3 match power9_v2.2 */
> + if ((pcc->pvr & 0xf) == 2) {
The comment is futuristic about DD2.3 although the condition checks only
for DD2.2, may be update comment for now and another patch later along
with other changes needed to support 2.3?
Otherwise, looks fine to me.
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
regards,
Harsh
> + return true;
> + }
> + }
> }
>
> return false;
> diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
> index 01cecd6e20..165ca13f8c 100644
> --- a/tests/qtest/device-plug-test.c
> +++ b/tests/qtest/device-plug-test.c
> @@ -168,8 +168,8 @@ static void test_spapr_cpu_unplug_request(void)
> {
> QTestState *qtest;
>
> - qtest = qtest_initf("-cpu power9_v2.0 -smp 1,maxcpus=2 "
> - "-device power9_v2.0-spapr-cpu-core,core-id=1,id=dev0");
> + qtest = qtest_initf("-cpu power9_v2.2 -smp 1,maxcpus=2 "
> + "-device power9_v2.2-spapr-cpu-core,core-id=1,id=dev0");
>
> /* similar to test_pci_unplug_request */
> process_device_remove(qtest, "dev0");
next prev parent reply other threads:[~2023-05-16 9:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 16:02 [PATCH v4] target/ppc: Add POWER9 DD2.2 model Nicholas Piggin
2023-05-16 7:56 ` Frederic Barrat
2023-05-16 9:44 ` Nicholas Piggin
2023-05-16 7:58 ` Frederic Barrat
2023-05-16 9:41 ` Nicholas Piggin
2023-05-16 8:44 ` Cédric Le Goater
2023-05-16 9:57 ` Nicholas Piggin
2023-05-16 9:23 ` Harsh Prateek Bora [this message]
2023-05-16 10:14 ` Nicholas Piggin
2023-05-28 16:15 ` Daniel Henrique Barboza
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=f9167007-ca18-eef6-5973-64da0ff4fedc@linux.ibm.com \
--to=harshpb@linux.ibm.com \
--cc=npiggin@gmail.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 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.