From: "Cédric Le Goater" <clg@kaod.org>
To: Michael Kowal <kowal@linux.ibm.com>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, fbarrat@linux.ibm.com, npiggin@gmail.com,
milesg@linux.ibm.com
Subject: Re: [PATCH 08/13] ppc/xive2: Support "Pull Thread Context to Register" operation
Date: Mon, 26 Aug 2024 13:46:17 +0200 [thread overview]
Message-ID: <496cadfe-f9dd-4ec3-8ff7-0aee2edea10f@kaod.org> (raw)
In-Reply-To: <20240801203008.11224-9-kowal@linux.ibm.com>
On 8/1/24 22:30, Michael Kowal wrote:
> From: Glenn Miles <milesg@linux.vnet.ibm.com>
>
> Adds support for single byte read of offset 0x838 of the TIMA address
> space. According to the XIVE2 Specification, this causes the hardware
> to atomically:
> 1. Read the number of bytes requested (lbz or lhz are supported).
> 2. Reset the valid bit of the thread context.
> 3. Return the number of bytes requested in step 1 to a register.
>
> Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
> Signed-off-by: Michael Kowal <kowal@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> include/hw/ppc/xive_regs.h | 2 ++
> hw/intc/xive.c | 15 +++++++++++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/include/hw/ppc/xive_regs.h b/include/hw/ppc/xive_regs.h
> index f8f05deafd..558a5ae742 100644
> --- a/include/hw/ppc/xive_regs.h
> +++ b/include/hw/ppc/xive_regs.h
> @@ -101,6 +101,7 @@
> #define TM_QW3W2_LP PPC_BIT32(6)
> #define TM_QW3W2_LE PPC_BIT32(7)
> #define TM_QW3W2_T PPC_BIT32(31)
> +#define TM_QW3B8_VT PPC_BIT8(0)
>
> /*
> * In addition to normal loads to "peek" and writes (only when invalid)
> @@ -128,6 +129,7 @@
> #define TM_SPC_PULL_POOL_CTX 0x828 /* Load32/Load64 Pull/Invalidate Pool */
> /* context to reg */
> #define TM_SPC_ACK_HV_REG 0x830 /* Load16 ack HV irq to reg */
> +#define TM_SPC_PULL_PHYS_CTX 0x838 /* Pull phys ctx to reg */
> #define TM_SPC_PULL_USR_CTX_OL 0xc08 /* Store8 Pull/Inval usr ctx to odd */
> /* line */
> #define TM_SPC_ACK_OS_EL 0xc10 /* Store8 ack OS irq to even line */
> diff --git a/hw/intc/xive.c b/hw/intc/xive.c
> index 6229a6f870..5b66a3aec5 100644
> --- a/hw/intc/xive.c
> +++ b/hw/intc/xive.c
> @@ -179,6 +179,17 @@ static uint64_t xive_tm_pull_pool_ctx(XivePresenter *xptr, XiveTCTX *tctx,
> return qw2w2;
> }
>
> +static uint64_t xive_tm_pull_phys_ctx(XivePresenter *xptr, XiveTCTX *tctx,
> + hwaddr offset, unsigned size)
> +{
> + uint8_t qw3b8_prev = tctx->regs[TM_QW3_HV_PHYS + TM_WORD2];
> + uint8_t qw3b8;
> +
> + qw3b8 = qw3b8_prev & ~TM_QW3B8_VT;
> + tctx->regs[TM_QW3_HV_PHYS + TM_WORD2] = qw3b8;
> + return qw3b8;
> +}
> +
> static void xive_tm_vt_push(XivePresenter *xptr, XiveTCTX *tctx, hwaddr offset,
> uint64_t value, unsigned size)
> {
> @@ -527,6 +538,8 @@ static const XiveTmOp xive_tm_operations[] = {
> xive_tm_pull_pool_ctx },
> { XIVE_TM_HV_PAGE, TM_SPC_PULL_POOL_CTX, 8, NULL,
> xive_tm_pull_pool_ctx },
> + { XIVE_TM_HV_PAGE, TM_SPC_PULL_PHYS_CTX, 1, NULL,
> + xive_tm_pull_phys_ctx },
> };
>
> static const XiveTmOp xive2_tm_operations[] = {
> @@ -566,6 +579,8 @@ static const XiveTmOp xive2_tm_operations[] = {
> xive_tm_pull_pool_ctx },
> { XIVE_TM_HV_PAGE, TM_SPC_PULL_OS_CTX_OL, 1, xive2_tm_pull_os_ctx_ol,
> NULL },
> + { XIVE_TM_HV_PAGE, TM_SPC_PULL_PHYS_CTX, 1, NULL,
> + xive_tm_pull_phys_ctx },
> };
>
> static const XiveTmOp *xive_tm_find_op(XivePresenter *xptr, hwaddr offset,
next prev parent reply other threads:[~2024-08-26 11:47 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 20:29 [PATCH 00/13] XIVE2 changes for TIMA operations Michael Kowal
2024-08-01 20:29 ` [PATCH 01/13] pnv/xive: TIMA patch sets pre-req alignment and formatting changes Michael Kowal
2024-08-26 10:14 ` Cédric Le Goater
2024-08-01 20:29 ` [PATCH 02/13] pnv/xive2: Define OGEN field in the TIMA Michael Kowal
2024-08-26 10:14 ` Cédric Le Goater
2024-08-01 20:29 ` [PATCH 03/13] ppc/xive2: Support TIMA "Pull OS Context to Odd Thread Reporting Line" Michael Kowal
2024-08-29 8:34 ` Cédric Le Goater
2024-08-01 20:29 ` [PATCH 04/13] pnv/xive2: Support for "OS LGS Push" TIMA operation Michael Kowal
2024-08-26 11:30 ` Cédric Le Goater
2024-08-01 20:30 ` [PATCH 05/13] ppc/xive2: Dump more NVP state with 'info pic' Michael Kowal
2024-08-26 11:39 ` Cédric Le Goater
2024-08-01 20:30 ` [PATCH 06/13] ppc/xive2: Dump the VP-group and crowd tables " Michael Kowal
2024-08-29 8:54 ` Cédric Le Goater
2024-08-01 20:30 ` [PATCH 07/13] ppc/xive2: Allow 1-byte write of Target field in TIMA Michael Kowal
2024-08-26 11:43 ` Cédric Le Goater
2024-08-01 20:30 ` [PATCH 08/13] ppc/xive2: Support "Pull Thread Context to Register" operation Michael Kowal
2024-08-26 11:46 ` Cédric Le Goater [this message]
2024-08-01 20:30 ` [PATCH 09/13] ppc/xive2: Support "Pull Thread Context to Odd Thread Reporting Line" Michael Kowal
2024-08-29 12:08 ` Cédric Le Goater
2024-08-29 20:13 ` Mike Kowal
2024-08-01 20:30 ` [PATCH 10/13] pnv/xive: Add special handling for pool targets Michael Kowal
2024-08-29 12:14 ` Cédric Le Goater
2024-08-29 20:27 ` Mike Kowal
2024-08-30 8:21 ` Cédric Le Goater
2024-08-01 20:30 ` [PATCH 11/13] pnv/xive: Update PIPR when updating CPPR Michael Kowal
2024-08-29 12:29 ` Cédric Le Goater
2024-08-29 20:35 ` Mike Kowal
2024-08-30 8:25 ` Cédric Le Goater
2024-08-30 17:06 ` Mike Kowal
2024-09-02 6:07 ` Cédric Le Goater
2024-08-29 12:58 ` Cédric Le Goater
2024-08-01 20:30 ` [PATCH 12/13] pnv/xive2: TIMA support for 8-byte OS context push for PHYP Michael Kowal
2024-08-28 11:51 ` Cédric Le Goater
2024-08-01 20:30 ` [PATCH 13/13] pnv/xive2: TIMA CI ops using alternative offsets or byte lengths Michael Kowal
2024-08-28 11:49 ` 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=496cadfe-f9dd-4ec3-8ff7-0aee2edea10f@kaod.org \
--to=clg@kaod.org \
--cc=fbarrat@linux.ibm.com \
--cc=kowal@linux.ibm.com \
--cc=milesg@linux.ibm.com \
--cc=npiggin@gmail.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).