From: Amit Machhiwal <amachhiw@linux.ibm.com>
To: qemu-ppc@nongnu.org, Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: Amit Machhiwal <amachhiw@linux.ibm.com>,
Vaibhav Jain <vaibhav@linux.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
Chinmay Rath <rathc@linux.ibm.com>,
Glenn Miles <milesg@linux.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [PATCH 0/2] ppc/kvm: Handle CPU compatibility mode correctly for nested guests
Date: Thu, 30 Apr 2026 11:43:31 +0530 [thread overview]
Message-ID: <20260430061333.37905-1-amachhiw@linux.ibm.com> (raw)
On POWER systems, newer processor generations can operate in compatibility
modes corresponding to earlier generations (e.g., a Power11 system running
in Power10 compatibility mode). In such cases, the effective CPU level
exposed to guests differs from the physical processor generation.
This creates issues for nested virtualization. When booting a nested KVM
guest, QEMU may derive the CPU model from the raw hardware PVR and attempt
to configure the guest accordingly. However, the host is constrained by the
compatibility level negotiated with the hypervisor, and requests exceeding
that level are rejected by KVM, leading to guest boot failures such as:
KVM-NESTEDv2: couldn't set guest wide elements
This series addresses the issue in two ways:
1. Do not silently fall back to raw mode when KVM rejects a requested
compatibility level during CAS. Instead, propagate the error so invalid
configurations are visible and fail early.
2. Query the effective CPU compatibility modes supported by the host via
KVM and use this information to select an appropriate CPU model for
nested guests.
With these changes, QEMU avoids masking KVM errors and ensures that nested
guests are configured with CPU models consistent with the host
compatibility mode, allowing them to boot correctly.
Patch summary:
[1/2] hw/ppc/spapr: Do not fallback to raw mode when KVM rejects compat
[2/2] target/ppc/kvm: Use host compatibility mode for nested guests
Tested on:
- Power11 pSeries LPAR in Power10 compatibility mode
- Power10 PowerNV and QEMU PowerNV 11 TCG L0 host
Note: The corresponding Linux patches have been posted [1]
[1] https://lore.kernel.org/all/20260430054906.94431-1-amachhiw@linux.ibm.com/
Amit Machhiwal (2):
hw/ppc/spapr: Do not fallback to raw mode when KVM rejects compat
target/ppc/kvm: Use host compatibility mode for nested guests
hw/ppc/spapr_hcall.c | 9 ++++++++
target/ppc/kvm.c | 52 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
base-commit: 759c456b1d22fe4083c8b384da27d3f56fd53f82
--
2.50.1
next reply other threads:[~2026-04-30 6:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 6:13 Amit Machhiwal [this message]
2026-04-30 6:13 ` [PATCH 2/2] target/ppc/kvm: Use host compatibility mode for nested guests Amit Machhiwal
2026-05-02 20:14 ` Amit Machhiwal
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=20260430061333.37905-1-amachhiw@linux.ibm.com \
--to=amachhiw@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=milesg@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rathc@linux.ibm.com \
--cc=vaibhav@linux.ibm.com \
/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