[Qemu-devel] [PATCH] spapr: Report kvm_irqchip_in_kernel() in 'info pic'

Greg Kurz posted 1 patch 6 years, 2 months ago
Test docker-clang@ubuntu passed
Test FreeBSD passed
Test checkpatch passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/156829860985.2073005.5893493824873412773.stgit@bahia.tls.ibm.com
Maintainers: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c |    4 ++++
1 file changed, 4 insertions(+)
[Qemu-devel] [PATCH] spapr: Report kvm_irqchip_in_kernel() in 'info pic'
Posted by Greg Kurz 6 years, 2 months ago
Unless the machine was started with kernel-irqchip=on, we cannot easily
tell if we're actually using an in-kernel or an emulated irqchip. This
information is important enough that it is worth printing it in 'info
pic'.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/spapr.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 761f8214c312..348c007ffbd3 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -81,6 +81,8 @@
 #include "hw/mem/memory-device.h"
 #include "hw/ppc/spapr_tpm_proxy.h"
 
+#include "monitor/monitor.h"
+
 #include <libfdt.h>
 
 /* SLOF memory layout:
@@ -4360,6 +4362,8 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj,
     SpaprMachineState *spapr = SPAPR_MACHINE(obj);
 
     spapr->irq->print_info(spapr, mon);
+    monitor_printf(mon, "irqchip: %s\n",
+                   kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
 }
 
 int spapr_get_vcpu_id(PowerPCCPU *cpu)


Re: [Qemu-devel] [PATCH] spapr: Report kvm_irqchip_in_kernel() in 'info pic'
Posted by Cédric Le Goater 6 years, 2 months ago
On 12/09/2019 16:30, Greg Kurz wrote:
> Unless the machine was started with kernel-irqchip=on, we cannot easily
> tell if we're actually using an in-kernel or an emulated irqchip. This
> information is important enough that it is worth printing it in 'info
> pic'.

Nice ! 
 
> Signed-off-by: Greg Kurz <groug@kaod.org>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>  hw/ppc/spapr.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 761f8214c312..348c007ffbd3 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -81,6 +81,8 @@
>  #include "hw/mem/memory-device.h"
>  #include "hw/ppc/spapr_tpm_proxy.h"
>  
> +#include "monitor/monitor.h"
> +
>  #include <libfdt.h>
>  
>  /* SLOF memory layout:
> @@ -4360,6 +4362,8 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj,
>      SpaprMachineState *spapr = SPAPR_MACHINE(obj);
>  
>      spapr->irq->print_info(spapr, mon);
> +    monitor_printf(mon, "irqchip: %s\n",
> +                   kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
>  }
>  
>  int spapr_get_vcpu_id(PowerPCCPU *cpu)
> 


Re: [Qemu-devel] [PATCH] spapr: Report kvm_irqchip_in_kernel() in 'info pic'
Posted by David Gibson 6 years, 1 month ago
On Thu, Sep 12, 2019 at 04:30:09PM +0200, Greg Kurz wrote:
65;5603;1c> Unless the machine was started with kernel-irqchip=on, we cannot easily
> tell if we're actually using an in-kernel or an emulated irqchip. This
> information is important enough that it is worth printing it in 'info
> pic'.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied, thanks.

> ---
>  hw/ppc/spapr.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 761f8214c312..348c007ffbd3 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -81,6 +81,8 @@
>  #include "hw/mem/memory-device.h"
>  #include "hw/ppc/spapr_tpm_proxy.h"
>  
> +#include "monitor/monitor.h"
> +
>  #include <libfdt.h>
>  
>  /* SLOF memory layout:
> @@ -4360,6 +4362,8 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj,
>      SpaprMachineState *spapr = SPAPR_MACHINE(obj);
>  
>      spapr->irq->print_info(spapr, mon);
> +    monitor_printf(mon, "irqchip: %s\n",
> +                   kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
>  }
>  
>  int spapr_get_vcpu_id(PowerPCCPU *cpu)
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson