All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <20201210032854.GH2555@yekko.fritz.box> (raw)
In-Reply-To: <20201209170052.1431440-4-groug@kaod.org>

[-- Attachment #1: Type: text/plain, Size: 3444 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-12-10  3:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 17:00 [PATCH 0/6] spapr: Drop some users of qdev_get_machine() Greg Kurz
2020-12-09 17:00 ` [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core Greg Kurz
2020-12-09 17:34   ` Philippe Mathieu-Daudé
2020-12-09 17:42     ` Greg Kurz
2020-12-09 17:53       ` Philippe Mathieu-Daudé
2020-12-09 18:11         ` Philippe Mathieu-Daudé
2020-12-09 18:26           ` Eduardo Habkost
2020-12-09 20:24             ` Greg Kurz
2020-12-09 20:54               ` Eduardo Habkost
2020-12-10  8:23                 ` Cédric Le Goater
2020-12-10  3:53             ` David Gibson
2020-12-10  8:54               ` Greg Kurz
2020-12-09 17:00 ` [PATCH 2/6] spapr: Add an "spapr" property to sPAPR PHB Greg Kurz
2020-12-09 17:00 ` [PATCH 3/6] spapr: Pass sPAPR machine state down to spapr_pci_switch_vga() Greg Kurz
2020-12-10  3:28   ` David Gibson [this message]
2020-12-09 17:00 ` [PATCH 4/6] spapr: Don't use qdev_get_machine() in spapr_msi_write() Greg Kurz
2020-12-10  3:30   ` David Gibson
2020-12-09 17:00 ` [PATCH 5/6] spapr: Pass sPAPR machine state to some RTAS events handling functions Greg Kurz
2020-12-10  3:31   ` David Gibson
2020-12-09 17:00 ` [PATCH 6/6] target/ppc: Add mce_req_event() handler to PPCVirtualHypervisorClass Greg Kurz
2020-12-10  3:54   ` David Gibson
2020-12-10  9:37     ` Greg Kurz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201210032854.GH2555@yekko.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.