qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/6] spapr: Pass sPAPR machine state down to spapr_pci_switch


From: David Gibson
Subject: Re: [PATCH 3/6] spapr: Pass sPAPR machine state down to spapr_pci_switch_vga()
Date: Thu, 10 Dec 2020 14:28:54 +1100

On Wed, Dec 09, 2020 at 06:00:49PM +0100, Greg Kurz wrote:
> This allows to drop a user of qdev_get_machine().
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied to ppc-for-6.0.

> ---
>  include/hw/ppc/spapr.h | 2 +-
>  hw/ppc/spapr_hcall.c   | 7 ++++---
>  hw/ppc/spapr_pci.c     | 3 +--
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> index b7ced9faebf5..e0f10f252c08 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -834,7 +834,7 @@ int spapr_dma_dt(void *fdt, int node_off, const char 
> *propname,
>                   uint32_t liobn, uint64_t window, uint32_t size);
>  int spapr_tcet_dma_dt(void *fdt, int node_off, const char *propname,
>                        SpaprTceTable *tcet);
> -void spapr_pci_switch_vga(bool big_endian);
> +void spapr_pci_switch_vga(SpaprMachineState *spapr, bool big_endian);
>  void spapr_hotplug_req_add_by_index(SpaprDrc *drc);
>  void spapr_hotplug_req_remove_by_index(SpaprDrc *drc);
>  void spapr_hotplug_req_add_by_count(SpaprDrcType drc_type,
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index 1d8e8e6a888f..c0ea0bd5794b 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -1351,6 +1351,7 @@ static target_ulong h_logical_dcbf(PowerPCCPU *cpu, 
> SpaprMachineState *spapr,
>  }
>  
>  static target_ulong h_set_mode_resource_le(PowerPCCPU *cpu,
> +                                           SpaprMachineState *spapr,
>                                             target_ulong mflags,
>                                             target_ulong value1,
>                                             target_ulong value2)
> @@ -1365,12 +1366,12 @@ static target_ulong h_set_mode_resource_le(PowerPCCPU 
> *cpu,
>      switch (mflags) {
>      case H_SET_MODE_ENDIAN_BIG:
>          spapr_set_all_lpcrs(0, LPCR_ILE);
> -        spapr_pci_switch_vga(true);
> +        spapr_pci_switch_vga(spapr, true);
>          return H_SUCCESS;
>  
>      case H_SET_MODE_ENDIAN_LITTLE:
>          spapr_set_all_lpcrs(LPCR_ILE, LPCR_ILE);
> -        spapr_pci_switch_vga(false);
> +        spapr_pci_switch_vga(spapr, false);
>          return H_SUCCESS;
>      }
>  
> @@ -1411,7 +1412,7 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, 
> SpaprMachineState *spapr,
>  
>      switch (resource) {
>      case H_SET_MODE_RESOURCE_LE:
> -        ret = h_set_mode_resource_le(cpu, args[0], args[2], args[3]);
> +        ret = h_set_mode_resource_le(cpu, spapr, args[0], args[2], args[3]);
>          break;
>      case H_SET_MODE_RESOURCE_ADDR_TRANS_MODE:
>          ret = h_set_mode_resource_addr_trans_mode(cpu, args[0],
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 2d9b88b93122..149bf4c21d22 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -2490,9 +2490,8 @@ static int spapr_switch_one_vga(DeviceState *dev, void 
> *opaque)
>      return 0;
>  }
>  
> -void spapr_pci_switch_vga(bool big_endian)
> +void spapr_pci_switch_vga(SpaprMachineState *spapr, bool big_endian)
>  {
> -    SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
>      SpaprPhbState *sphb;
>  
>      /*

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