[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v5 28/36] ppc/xics: introduce a icp_kvm_init() rou
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH v5 28/36] ppc/xics: introduce a icp_kvm_init() routine |
Date: |
Thu, 29 Nov 2018 15:08:06 +1100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Fri, Nov 16, 2018 at 11:57:21AM +0100, Cédric Le Goater wrote:
> This routine gathers all the KVM initialization of the XICS KVM
> presenter. It will be useful when the initialization of the KVM XICS
> device is moved to a global routine.
>
> Signed-off-by: Cédric Le Goater <address@hidden>
I dislike calling things *_init() because it's not clear which of
qemu's many "init" hooks it belongs with.
> ---
> hw/intc/xics_kvm.c | 29 +++++++++++++++++++----------
> 1 file changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> index e8fa9a53aeba..efad1b19d821 100644
> --- a/hw/intc/xics_kvm.c
> +++ b/hw/intc/xics_kvm.c
> @@ -123,11 +123,8 @@ static void icp_kvm_reset(DeviceState *dev)
> icp_set_kvm_state(ICP(dev), 1);
> }
>
> -static void icp_kvm_realize(DeviceState *dev, Error **errp)
> +static void icp_kvm_init(ICPState *icp, Error **errp)
> {
> - ICPState *icp = ICP(dev);
> - ICPStateClass *icpc = ICP_GET_CLASS(icp);
> - Error *local_err = NULL;
> CPUState *cs;
> KVMEnabledICP *enabled_icp;
> unsigned long vcpu_id;
> @@ -137,12 +134,6 @@ static void icp_kvm_realize(DeviceState *dev, Error
> **errp)
> abort();
> }
>
> - icpc->parent_realize(dev, &local_err);
> - if (local_err) {
> - error_propagate(errp, local_err);
> - return;
> - }
> -
> cs = icp->cs;
> vcpu_id = kvm_arch_vcpu_id(cs);
>
> @@ -168,6 +159,24 @@ static void icp_kvm_realize(DeviceState *dev, Error
> **errp)
> QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node);
> }
>
> +static void icp_kvm_realize(DeviceState *dev, Error **errp)
> +{
> + ICPStateClass *icpc = ICP_GET_CLASS(dev);
> + Error *local_err = NULL;
> +
> + icpc->parent_realize(dev, &local_err);
> + if (local_err) {
> + error_propagate(errp, local_err);
> + return;
> + }
> +
> + icp_kvm_init(ICP(dev), &local_err);
> + if (local_err) {
> + error_propagate(errp, local_err);
> + return;
> + }
> +}
> +
> static void icp_kvm_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
--
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 v5 22/36] spapr/xive: add models for KVM support, (continued)
[Qemu-ppc] [PATCH v5 27/36] sysbus: add a sysbus_mmio_unmap() helper, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 25/36] spapr: set the interrupt presenter at reset, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 29/36] ppc/xics: remove abort() in icp_kvm_init(), Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 28/36] ppc/xics: introduce a icp_kvm_init() routine, Cédric Le Goater, 2018/11/16
- Re: [Qemu-ppc] [PATCH v5 28/36] ppc/xics: introduce a icp_kvm_init() routine,
David Gibson <=
[Qemu-ppc] [PATCH v5 32/36] spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 31/36] spapr/xive: export the spapr_xive_kvm_init() routine, Cédric Le Goater, 2018/11/16
[Qemu-ppc] [PATCH v5 34/36] spapr: add KVM support to the 'dual' machine, Cédric Le Goater, 2018/11/16