Blame SOURCES/kvm-ppc-Don-t-use-CPUPPCState-irq_input_state-with-moder.patch

22c213
From f2f57c1ed926384e074d2048cdbdc30ee2f426eb Mon Sep 17 00:00:00 2001
22c213
From: David Gibson <dgibson@redhat.com>
22c213
Date: Tue, 21 Jan 2020 05:16:13 +0000
22c213
Subject: [PATCH 03/15] ppc: Don't use CPUPPCState::irq_input_state with modern
22c213
 Book3s CPU models
22c213
MIME-Version: 1.0
22c213
Content-Type: text/plain; charset=UTF-8
22c213
Content-Transfer-Encoding: 8bit
22c213
22c213
RH-Author: David Gibson <dgibson@redhat.com>
22c213
Message-id: <20200121051613.388295-4-dgibson@redhat.com>
22c213
Patchwork-id: 93431
22c213
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 3/3] ppc: Don't use CPUPPCState::irq_input_state with modern Book3s CPU models
22c213
Bugzilla: 1776638
22c213
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
22c213
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
22c213
RH-Acked-by: Thomas Huth <thuth@redhat.com>
22c213
22c213
From: Greg Kurz <groug@kaod.org>
22c213
22c213
The power7_set_irq() and power9_set_irq() functions set this but it is
22c213
never used actually. Modern Book3s compatible CPUs are only supported
22c213
by the pnv and spapr machines. They have an interrupt controller, XICS
22c213
for POWER7/8 and XIVE for POWER9, whose models don't require to track
22c213
IRQ input states at the CPU level.
22c213
22c213
Drop these lines to avoid confusion.
22c213
22c213
Signed-off-by: Greg Kurz <groug@kaod.org>
22c213
Message-Id: <157548862861.3650476.16622818876928044450.stgit@bahia.lan>
22c213
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
22c213
(cherry picked from commit c1ad0b892ce20cf2b5e619c79e8a0c4c66b235dc)
22c213
22c213
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1776638
22c213
22c213
Signed-off-by: David Gibson <dgibson@redhat.com>
22c213
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
22c213
---
22c213
 hw/ppc/ppc.c     | 16 ++--------------
22c213
 target/ppc/cpu.h |  4 +++-
22c213
 2 files changed, 5 insertions(+), 15 deletions(-)
22c213
22c213
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
22c213
index d554b64..730a41f 100644
22c213
--- a/hw/ppc/ppc.c
22c213
+++ b/hw/ppc/ppc.c
22c213
@@ -275,10 +275,9 @@ void ppc970_irq_init(PowerPCCPU *cpu)
22c213
 static void power7_set_irq(void *opaque, int pin, int level)
22c213
 {
22c213
     PowerPCCPU *cpu = opaque;
22c213
-    CPUPPCState *env = &cpu->env;
22c213
 
22c213
     LOG_IRQ("%s: env %p pin %d level %d\n", __func__,
22c213
-                env, pin, level);
22c213
+            &cpu->env, pin, level);
22c213
 
22c213
     switch (pin) {
22c213
     case POWER7_INPUT_INT:
22c213
@@ -292,11 +291,6 @@ static void power7_set_irq(void *opaque, int pin, int level)
22c213
         LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
22c213
         return;
22c213
     }
22c213
-    if (level) {
22c213
-        env->irq_input_state |= 1 << pin;
22c213
-    } else {
22c213
-        env->irq_input_state &= ~(1 << pin);
22c213
-    }
22c213
 }
22c213
 
22c213
 void ppcPOWER7_irq_init(PowerPCCPU *cpu)
22c213
@@ -311,10 +305,9 @@ void ppcPOWER7_irq_init(PowerPCCPU *cpu)
22c213
 static void power9_set_irq(void *opaque, int pin, int level)
22c213
 {
22c213
     PowerPCCPU *cpu = opaque;
22c213
-    CPUPPCState *env = &cpu->env;
22c213
 
22c213
     LOG_IRQ("%s: env %p pin %d level %d\n", __func__,
22c213
-                env, pin, level);
22c213
+            &cpu->env, pin, level);
22c213
 
22c213
     switch (pin) {
22c213
     case POWER9_INPUT_INT:
22c213
@@ -334,11 +327,6 @@ static void power9_set_irq(void *opaque, int pin, int level)
22c213
         LOG_IRQ("%s: unknown IRQ pin %d\n", __func__, pin);
22c213
         return;
22c213
     }
22c213
-    if (level) {
22c213
-        env->irq_input_state |= 1 << pin;
22c213
-    } else {
22c213
-        env->irq_input_state &= ~(1 << pin);
22c213
-    }
22c213
 }
22c213
 
22c213
 void ppcPOWER9_irq_init(PowerPCCPU *cpu)
22c213
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
22c213
index 5c53801..8887f76 100644
22c213
--- a/target/ppc/cpu.h
22c213
+++ b/target/ppc/cpu.h
22c213
@@ -1090,7 +1090,9 @@ struct CPUPPCState {
22c213
 #if !defined(CONFIG_USER_ONLY)
22c213
     /*
22c213
      * This is the IRQ controller, which is implementation dependent
22c213
-     * and only relevant when emulating a complete machine.
22c213
+     * and only relevant when emulating a complete machine. Note that
22c213
+     * this isn't used by recent Book3s compatible CPUs (POWER7 and
22c213
+     * newer).
22c213
      */
22c213
     uint32_t irq_input_state;
22c213
     void **irq_inputs;
22c213
-- 
22c213
1.8.3.1
22c213