qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH 37/77] ppc/xics: Split ICS into base class and "si


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH 37/77] ppc/xics: Split ICS into base class and "simple" implementation
Date: Tue, 1 Dec 2015 16:13:56 +1100
User-agent: Mutt/1.5.24 (2015-08-30)

On Wed, Nov 11, 2015 at 11:27:50AM +1100, Benjamin Herrenschmidt wrote:
> The existing implementation becomes the "ics-simple" subclass of ICS,
> so there should be no change in behaviour for SPAPR.
> 
> This will allow different implementations for the source controllers
> such as the MSI support of PHB3 on Power8 which uses in-memory state
> tables for example.
> 
> Signed-off-by: Benjamin Herrenschmidt <address@hidden>

[snip]

> diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
> index fc331d8..f7d444a 100644
> --- a/hw/intc/xics_spapr.c
> +++ b/hw/intc/xics_spapr.c
> @@ -112,7 +112,7 @@ static void rtas_set_xive(PowerPCCPU *cpu, 
> sPAPRMachineState *spapr,
>                            uint32_t nret, target_ulong rets)
>  {
>      ICSState *ics = QLIST_FIRST(&spapr->xics->ics);
> -    uint32_t nr, server, priority;
> +    uint32_t nr, src_no, server, priority;

Nit: elsewhere I use srcno without a _ for this value.

[snip]
> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> index 5acb329..93a627b 100644
> --- a/include/hw/ppc/xics.h
> +++ b/include/hw/ppc/xics.h
> @@ -116,6 +116,9 @@ struct ICPState {
>  #define TYPE_ICS "ics"
>  #define ICS(obj) OBJECT_CHECK(ICSState, (obj), TYPE_ICS)
>  
> +#define TYPE_ICS_SIMPLE "ics-simple"
> +#define ICS_SIMPLE(obj) OBJECT_CHECK(ICSState, (obj), TYPE_ICS_SIMPLE)

Again, changing type names will break migration, I believe.  So better
to leave this as ics and add "ics-base" and "ics-native" or similar.

> +
>  #define TYPE_KVM_ICS "icskvm"
>  #define KVM_ICS(obj) OBJECT_CHECK(ICSState, (obj), TYPE_KVM_ICS)
>  
> @@ -129,6 +132,9 @@ struct ICSStateClass {
>  
>      void (*pre_save)(ICSState *s);
>      int (*post_load)(ICSState *s, int version_id);
> +    void (*reject)(ICSState *s, uint32_t irq);
> +    void (*resend)(ICSState *s);
> +    void (*eoi)(ICSState *s, uint32_t irq);
>  };
>  
>  struct ICSState {
> @@ -184,10 +190,10 @@ uint32_t icp_accept(ICPState *ss);
>  uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr);
>  void icp_eoi(XICSState *icp, int server, uint32_t xirr);
>  
> -void ics_write_xive(ICSState *ics, int nr, int server,
> -                    uint8_t priority, uint8_t saved_priority);
> +void ics_simple_write_xive(ICSState *ics, int nr, int server,
> +                           uint8_t priority, uint8_t saved_priority);
>  
> -void ics_set_irq_type(ICSState *ics, int srcno, bool lsi);
> +void ics_simple_set_irq_type(ICSState *ics, int srcno, bool lsi);
>  
>  void xics_set_nr_servers(XICSState *icp, uint32_t nr_servers, Error **errp);
>  ICSState *xics_find_source(XICSState *icp, int irq);

-- 
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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]