From: Michael Kowal <kowal@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, clg@kaod.org, fbarrat@linux.ibm.com,
npiggin@gmail.com, milesg@linux.ibm.com
Subject: [PATCH 07/13] ppc/xive2: Allow 1-byte write of Target field in TIMA
Date: Thu, 1 Aug 2024 15:30:02 -0500 [thread overview]
Message-ID: <20240801203008.11224-8-kowal@linux.ibm.com> (raw)
In-Reply-To: <20240801203008.11224-1-kowal@linux.ibm.com>
From: Glenn Miles <milesg@linux.vnet.ibm.com>
When running PowerVM, the console is littered with XIVE traces regarding
invalid writes to TIMA address 0x100b6 due to a lack of support for writes
to the "TARGET" field which was added for XIVE GEN2. To fix this, we add
special op support for 1-byte writes to this field.
Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Michael Kowal <kowal@linux.ibm.com>
---
include/hw/ppc/xive2.h | 2 ++
include/hw/ppc/xive_regs.h | 1 +
hw/intc/xive.c | 2 ++
hw/intc/xive2.c | 13 +++++++++++++
4 files changed, 18 insertions(+)
diff --git a/include/hw/ppc/xive2.h b/include/hw/ppc/xive2.h
index b7a7c33ddd..36bd0e747f 100644
--- a/include/hw/ppc/xive2.h
+++ b/include/hw/ppc/xive2.h
@@ -121,5 +121,7 @@ uint64_t xive2_tm_pull_os_ctx(XivePresenter *xptr, XiveTCTX *tctx,
hwaddr offset, unsigned size);
void xive2_tm_pull_os_ctx_ol(XivePresenter *xptr, XiveTCTX *tctx,
hwaddr offset, uint64_t value, unsigned size);
+void xive2_tm_set_hv_target(XivePresenter *xptr, XiveTCTX *tctx,
+ hwaddr offset, uint64_t value, unsigned size);
#endif /* PPC_XIVE2_H */
diff --git a/include/hw/ppc/xive_regs.h b/include/hw/ppc/xive_regs.h
index 27a744d50d..f8f05deafd 100644
--- a/include/hw/ppc/xive_regs.h
+++ b/include/hw/ppc/xive_regs.h
@@ -79,6 +79,7 @@
#define TM_INC 0x5 /* - + - + */
#define TM_LGS 0x5 /* + + + + */ /* Rename P10 */
#define TM_AGE 0x6 /* - + - + */
+#define TM_T 0x6 /* - + - + */ /* Rename P10 */
#define TM_PIPR 0x7 /* - + - + */
#define TM_OGEN 0xF /* - + - - */ /* P10 only */
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 8605dd618f..6229a6f870 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -546,6 +546,8 @@ static const XiveTmOp xive2_tm_operations[] = {
NULL },
{ XIVE_TM_HV_PAGE, TM_QW3_HV_PHYS + TM_WORD2, 1, NULL,
xive_tm_vt_poll },
+ { XIVE_TM_HV_PAGE, TM_QW3_HV_PHYS + TM_T, 1, xive2_tm_set_hv_target,
+ NULL },
/* MMIOs above 2K : special operations with side effects */
{ XIVE_TM_OS_PAGE, TM_SPC_ACK_OS_REG, 2, NULL,
diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c
index 9d19273bc8..eed0cc9c3c 100644
--- a/hw/intc/xive2.c
+++ b/hw/intc/xive2.c
@@ -600,6 +600,19 @@ void xive2_tm_push_os_ctx(XivePresenter *xptr, XiveTCTX *tctx,
}
}
+static void xive2_tctx_set_target(XiveTCTX *tctx, uint8_t ring, uint8_t target)
+{
+ uint8_t *regs = &tctx->regs[ring];
+
+ regs[TM_T] = target;
+}
+
+void xive2_tm_set_hv_target(XivePresenter *xptr, XiveTCTX *tctx,
+ hwaddr offset, uint64_t value, unsigned size)
+{
+ xive2_tctx_set_target(tctx, TM_QW3_HV_PHYS, value & 0xff);
+}
+
/*
* XIVE Router (aka. Virtualization Controller or IVRE)
*/
--
2.43.0
next prev parent reply other threads:[~2024-08-01 20:32 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 ` Michael Kowal [this message]
2024-08-26 11:43 ` [PATCH 07/13] ppc/xive2: Allow 1-byte write of Target field in TIMA 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
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=20240801203008.11224-8-kowal@linux.ibm.com \
--to=kowal@linux.ibm.com \
--cc=clg@kaod.org \
--cc=fbarrat@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).