diff mbox series

[3/8] ppc/spapr: Remove copy-paste from pa-features under TCG

Message ID 20240118140942.164319-4-npiggin@gmail.com
State New
Headers show
Series ppc: Update targets for Power machines (spapr and pnv) | expand

Commit Message

Nicholas Piggin Jan. 18, 2024, 2:09 p.m. UTC
TCG does not support copy/paste instructions. Remove it from
ibm,pa-features when running TCG. Similarly to SAO, there is a
migration issue here, but this doesn't really make things worse,
a cap would be required to fix it.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 hw/ppc/spapr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 1c79d5670d..ce969be770 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -299,6 +299,18 @@  static void spapr_dt_pa_features(SpaprMachineState *spapr,
         pa_features[4 + 2] &= ~0x80;
     }
 
+    if (tcg_enabled()) {
+        /*
+         * TCG does not implement copy/paste instructions. This causes a
+         * migration issue similarly to SAO, but there is no avoiding that
+         * since there is no KVM cap or way to disable the instructions in
+         * hardware. It's also quite an obscure instruction and is not really
+         * used in KVM guests since KVM does not support accelerator pass-
+         * through anyway.
+         */
+        pa_features[38 + 2] &= ~0x80;
+    }
+
     if (ppc_hash64_has(cpu, PPC_HASH64_CI_LARGEPAGE)) {
         /*
          * Note: we keep CI large pages off by default because a 64K capable