[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v2 06/22] ppc/xics: use the QOM interface under th
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH v2 06/22] ppc/xics: use the QOM interface under the sPAPR machine |
Date: |
Thu, 23 Feb 2017 13:21:53 +1100 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Thu, Feb 16, 2017 at 02:47:29PM +0100, Cédric Le Goater wrote:
> Add 'ics_get' and 'ics_resend' handlers to the sPAPR machine. These
> are relatively simple for a single ICS.
>
> Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: David Gibson <address@hidden>
> ---
> hw/intc/xics.c | 2 +-
> hw/ppc/spapr.c | 18 ++++++++++++++++++
> include/hw/ppc/xics.h | 1 +
> 3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/hw/intc/xics.c b/hw/intc/xics.c
> index 3e80d2d0f0d9..39c442f70116 100644
> --- a/hw/intc/xics.c
> +++ b/hw/intc/xics.c
> @@ -193,7 +193,7 @@ static void ics_reject(ICSState *ics, uint32_t nr)
> }
> }
>
> -static void ics_resend(ICSState *ics)
> +void ics_resend(ICSState *ics)
> {
> ICSStateClass *k = ICS_BASE_GET_CLASS(ics);
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 045f2323a4e9..85a973cce7ae 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2901,6 +2901,20 @@ static void spapr_phb_placement(sPAPRMachineState
> *spapr, uint32_t index,
> *mmio64 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE;
> }
>
> +static ICSState *spapr_ics_get(XICSInterface *dev, int irq)
> +{
> + sPAPRMachineState *spapr = SPAPR_MACHINE(dev);
> +
> + return ics_valid_irq(spapr->ics, irq) ? spapr->ics : NULL;
> +}
> +
> +static void spapr_ics_resend(XICSInterface *dev)
> +{
> + sPAPRMachineState *spapr = SPAPR_MACHINE(dev);
> +
> + ics_resend(spapr->ics);
> +}
> +
> static void spapr_machine_class_init(ObjectClass *oc, void *data)
> {
> MachineClass *mc = MACHINE_CLASS(oc);
> @@ -2909,6 +2923,7 @@ static void spapr_machine_class_init(ObjectClass *oc,
> void *data)
> NMIClass *nc = NMI_CLASS(oc);
> HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
> PPCVirtualHypervisorClass *vhc = PPC_VIRTUAL_HYPERVISOR_CLASS(oc);
> + XICSInterfaceClass *xic = XICS_INTERFACE_CLASS(oc);
>
> mc->desc = "pSeries Logical Partition (PAPR compliant)";
>
> @@ -2942,6 +2957,8 @@ static void spapr_machine_class_init(ObjectClass *oc,
> void *data)
> nc->nmi_monitor_handler = spapr_nmi;
> smc->phb_placement = spapr_phb_placement;
> vhc->hypercall = emulate_spapr_hypercall;
> + xic->ics_get = spapr_ics_get;
> + xic->ics_resend = spapr_ics_resend;
> }
>
> static const TypeInfo spapr_machine_info = {
> @@ -2958,6 +2975,7 @@ static const TypeInfo spapr_machine_info = {
> { TYPE_NMI },
> { TYPE_HOTPLUG_HANDLER },
> { TYPE_PPC_VIRTUAL_HYPERVISOR },
> + { TYPE_XICS_INTERFACE },
> { }
> },
> };
> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> index fe2bb5c8ef54..640603b3d76d 100644
> --- a/include/hw/ppc/xics.h
> +++ b/include/hw/ppc/xics.h
> @@ -222,5 +222,6 @@ void ics_simple_write_xive(ICSState *ics, int nr, int
> server,
> void ics_set_irq_type(ICSState *ics, int srcno, bool lsi);
>
> ICSState *xics_find_source(XICSState *icp, int irq);
> +void ics_resend(ICSState *ics);
>
> #endif /* XICS_H */
--
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
signature.asc
Description: PGP signature
- Re: [Qemu-ppc] [PATCH v2 03/22] ppc/xics: store the ICS object under the sPAPR machine, (continued)
[Qemu-ppc] [PATCH v2 05/22] ppc/xics: introduce a QOM interface to handle ICSs, Cédric Le Goater, 2017/02/16
[Qemu-ppc] [PATCH v2 06/22] ppc/xics: use the QOM interface under the sPAPR machine, Cédric Le Goater, 2017/02/16
- Re: [Qemu-ppc] [PATCH v2 06/22] ppc/xics: use the QOM interface under the sPAPR machine,
David Gibson <=
[Qemu-ppc] [PATCH v2 07/22] ppc/xics: use the QOM interface to get irqs, Cédric Le Goater, 2017/02/16
[Qemu-ppc] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs, Cédric Le Goater, 2017/02/16
[Qemu-ppc] [PATCH v2 09/22] ppc/xics: remove xics_find_source(), Cédric Le Goater, 2017/02/16