qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Michael Kowal" <kowal@linux.ibm.com>, <qemu-devel@nongnu.org>
Cc: <qemu-ppc@nongnu.org>, <clg@kaod.org>, <fbarrat@linux.ibm.com>,
	<milesg@linux.ibm.com>
Subject: Re: [PATCH v4 04/11] pnv/xive2: Add NVG and NVC to cache watch facility
Date: Fri, 02 Aug 2024 11:41:12 +1000	[thread overview]
Message-ID: <D351KQYRFR7O.CVO9X3Y89JG0@gmail.com> (raw)
In-Reply-To: <20240724212130.26811-5-kowal@linux.ibm.com>

On Thu Jul 25, 2024 at 7:21 AM AEST, Michael Kowal wrote:
> From: Frederic Barrat <fbarrat@linux.ibm.com>
>
> The cache watch facility uses the same register interface to handle
> entries in the NVP, NVG and NVC tables. A bit-field in the 'watchX
> specification' register tells the table type. So far, that bit-field
> was not read and the code assumed a read/write to the NVP table.
>
> This patch allows to read/write entries in the NVG and NVC table as
> well.
>
> Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
> Signed-off-by: Michael Kowal <kowal@linux.vnet.ibm.com>
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> ---
>  hw/intc/pnv_xive2.c | 49 +++++++++++++++++++++++++++++++++++----------
>  1 file changed, 38 insertions(+), 11 deletions(-)
>
> diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c
> index 3dbbfddacb..dfb0927fd3 100644
> --- a/hw/intc/pnv_xive2.c
> +++ b/hw/intc/pnv_xive2.c
> @@ -465,10 +465,30 @@ static int pnv_xive2_write_nvp(Xive2Router *xrtr, uint8_t blk, uint32_t idx,
>                                word_number);
>  }
>  
> -static int pnv_xive2_nvp_update(PnvXive2 *xive, uint8_t watch_engine)
> +static int pnv_xive2_nxc_to_table_type(uint8_t nxc_type, uint32_t *table_type)
>  {
> -    uint8_t  blk;
> -    uint32_t idx;
> +    switch (nxc_type) {
> +    case PC_NXC_WATCH_NXC_NVP:
> +        *table_type = VST_NVP;
> +        break;
> +    case PC_NXC_WATCH_NXC_NVG:
> +        *table_type = VST_NVG;
> +        break;
> +    case PC_NXC_WATCH_NXC_NVC:
> +        *table_type = VST_NVC;
> +        break;
> +    default:
> +        qemu_log_mask(LOG_GUEST_ERROR,
> +                      "XIVE: invalid table type for nxc operation\n");
> +        return -1;
> +    }
> +    return 0;
> +}
> +
> +static int pnv_xive2_nxc_update(PnvXive2 *xive, uint8_t watch_engine)
> +{
> +    uint8_t  blk, nxc_type;
> +    uint32_t idx, table_type = -1;
>      int i, spec_reg, data_reg;
>      uint64_t nxc_watch[4];
>  
> @@ -476,21 +496,24 @@ static int pnv_xive2_nvp_update(PnvXive2 *xive, uint8_t watch_engine)
>  
>      spec_reg = (PC_NXC_WATCH0_SPEC + watch_engine * 0x40) >> 3;
>      data_reg = (PC_NXC_WATCH0_DATA0 + watch_engine * 0x40) >> 3;
> +    nxc_type = GETFIELD(PC_NXC_WATCH_NXC_TYPE, xive->pc_regs[spec_reg]);
>      blk = GETFIELD(PC_NXC_WATCH_BLOCK_ID, xive->pc_regs[spec_reg]);
>      idx = GETFIELD(PC_NXC_WATCH_INDEX, xive->pc_regs[spec_reg]);
>  
> +    assert(pnv_xive2_nxc_to_table_type(nxc_type, &table_type));

Hey Mike,

Was in a bit of a rush and forgot to let you know earlier (thanks for
reminding me) - I flipped the assert condition on these when merging.
IIRC I got an always-false warning on one of the CI tests there, but I
can't seem to find which one, or why it didn't usually warn.

I know you're part way through wrangling a bunch of other xive stuff
that makes this stuff difficult to test, so no worries.

Thanks,
Nick


  reply	other threads:[~2024-08-02  1:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 21:21 [PATCH v4 00/11] XIVE changes for Cache Watch, VSTs, STT and info pic Michael Kowal
2024-07-24 21:21 ` [PATCH v4 01/11] pnv/xive2: XIVE2 Cache Watch, Cache Flush and Sync Injection support Michael Kowal
2024-07-24 21:21 ` [PATCH v4 02/11] pnv/xive2: Structure/define alignment changes Michael Kowal
2024-07-24 21:21 ` [PATCH v4 03/11] pnv/xive: Support cache flush and queue sync inject with notifications Michael Kowal
2024-07-24 21:21 ` [PATCH v4 04/11] pnv/xive2: Add NVG and NVC to cache watch facility Michael Kowal
2024-08-02  1:41   ` Nicholas Piggin [this message]
2024-07-24 21:21 ` [PATCH v4 05/11] pnv/xive2: Configure Virtualization Structure Tables through the PC Michael Kowal
2024-07-24 21:21 ` [PATCH v4 06/11] pnv/xive2: Enable VST NVG and NVC index compression Michael Kowal
2024-07-24 21:21 ` [PATCH v4 07/11] pnv/xive2: Set Translation Table for the NVC port space Michael Kowal
2024-07-24 21:21 ` [PATCH v4 08/11] pnv/xive2: Fail VST entry address computation if table has no VSD Michael Kowal
2024-07-24 21:21 ` [PATCH v4 09/11] pnv/xive2: Move xive2_nvp_pic_print_info() to xive2.c Michael Kowal
2024-07-25  8:04   ` Cédric Le Goater
2024-07-24 21:21 ` [PATCH v4 10/11] pnv/xive2: Refine TIMA 'info pic' output Michael Kowal
2024-07-25  8:02   ` Cédric Le Goater
2024-07-24 21:21 ` [PATCH v4 11/11] pnv/xive2: Dump more END state with 'info pic' Michael Kowal
2024-07-25  8:02   ` Cédric Le Goater

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=D351KQYRFR7O.CVO9X3Y89JG0@gmail.com \
    --to=npiggin@gmail.com \
    --cc=clg@kaod.org \
    --cc=fbarrat@linux.ibm.com \
    --cc=kowal@linux.ibm.com \
    --cc=milesg@linux.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).