qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 18/25] ppc/pnv: Skip empty slots of the XIVE NVT table


From: David Gibson
Subject: Re: [PATCH v4 18/25] ppc/pnv: Skip empty slots of the XIVE NVT table
Date: Thu, 3 Oct 2019 12:22:28 +1000
User-agent: Mutt/1.12.1 (2019-06-15)

On Wed, Sep 18, 2019 at 06:06:38PM +0200, Cédric Le Goater wrote:
> We try to loop on the full table skipping empty indirect pages which
> are not necessarily allocated. This is useful to dump the contexts of
> the KVM vCPUs.

I think this patch can be merged into the previous one.  They're both
short, so we might as well get the dumping code correct first time.

> 
> Signed-off-by: Cédric Le Goater <address@hidden>
> ---
>  hw/intc/pnv_xive.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
> index 782775136288..a986d4ed9364 100644
> --- a/hw/intc/pnv_xive.c
> +++ b/hw/intc/pnv_xive.c
> @@ -1641,6 +1641,12 @@ static const MemoryRegionOps pnv_xive_pc_ops = {
>      },
>  };
>  
> +/*
> + * skiboot uses an indirect NVT table with 64k subpages
> + */
> +#define XIVE_NVT_COUNT          (1 << XIVE_NVT_SHIFT)
> +#define XIVE_NVT_PER_PAGE       (0x10000 / sizeof(XiveNVT))
> +
>  static void xive_nvt_pic_print_info(XiveNVT *nvt, uint32_t nvt_idx,
>                                      Monitor *mon)
>  {
> @@ -1694,10 +1700,12 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor 
> *mon)
>          xive_end_eas_pic_print_info(&end, i++, mon);
>      }
>  
> -    monitor_printf(mon, "XIVE[%x] NVTT\n", blk);
> -    i = 0;
> -    while (!xive_router_get_nvt(xrtr, blk, i, &nvt)) {
> -        xive_nvt_pic_print_info(&nvt, i++, mon);
> +    monitor_printf(mon, "XIVE[%x] NVTT %08x .. %08x\n", blk, 0,
> +                   XIVE_NVT_COUNT - 1);
> +    for (i = 0; i < XIVE_NVT_COUNT; i += XIVE_NVT_PER_PAGE) {
> +        while (!xive_router_get_nvt(xrtr, blk, i, &nvt)) {
> +            xive_nvt_pic_print_info(&nvt, i++, mon);
> +        }
>      }
>  }
>  

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