[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 23/42] ppc/xive: Implement TM_PULL_OS_CTX special com
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 23/42] ppc/xive: Implement TM_PULL_OS_CTX special command |
Date: |
Wed, 21 Aug 2019 17:25:23 +1000 |
From: Cédric Le Goater <address@hidden>
When a vCPU is not dispatched anymore on a HW thread, the Hypervisor
(KVM on Linux) invalidates the OS interrupt context of a vCPU with
this special command. It returns the OS CAM line value and resets the
VO bit.
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xive.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 7a6e4b763a..ab7ce64a83 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -337,6 +337,17 @@ static void xive_tm_set_os_pending(XiveTCTX *tctx, hwaddr
offset,
xive_tctx_notify(tctx, TM_QW1_OS);
}
+static uint64_t xive_tm_pull_os_ctx(XiveTCTX *tctx, hwaddr offset,
+ unsigned size)
+{
+ uint32_t qw1w2_prev = xive_tctx_word2(&tctx->regs[TM_QW1_OS]);
+ uint32_t qw1w2;
+
+ qw1w2 = xive_set_field32(TM_QW1W2_VO, qw1w2_prev, 0);
+ memcpy(&tctx->regs[TM_QW1_OS + TM_WORD2], &qw1w2, 4);
+ return qw1w2;
+}
+
/*
* Define a mapping of "special" operations depending on the TIMA page
* offset and the size of the operation.
@@ -363,6 +374,8 @@ static const XiveTmOp xive_tm_operations[] = {
/* MMIOs above 2K : special operations with side effects */
{ XIVE_TM_OS_PAGE, TM_SPC_ACK_OS_REG, 2, NULL, xive_tm_ack_os_reg },
{ XIVE_TM_OS_PAGE, TM_SPC_SET_OS_PENDING, 1, xive_tm_set_os_pending, NULL
},
+ { XIVE_TM_HV_PAGE, TM_SPC_PULL_OS_CTX, 4, NULL, xive_tm_pull_os_ctx },
+ { XIVE_TM_HV_PAGE, TM_SPC_PULL_OS_CTX, 8, NULL, xive_tm_pull_os_ctx },
{ XIVE_TM_HV_PAGE, TM_SPC_ACK_HV_REG, 2, NULL, xive_tm_ack_hv_reg },
{ XIVE_TM_HV_PAGE, TM_SPC_PULL_POOL_CTX, 4, NULL, xive_tm_pull_pool_ctx },
{ XIVE_TM_HV_PAGE, TM_SPC_PULL_POOL_CTX, 8, NULL, xive_tm_pull_pool_ctx },
@@ -406,7 +419,7 @@ void xive_tctx_tm_write(XiveTCTX *tctx, hwaddr offset,
uint64_t value,
if (offset & 0x800) {
xto = xive_tm_find_op(offset, size, true);
if (!xto) {
- qemu_log_mask(LOG_GUEST_ERROR, "XIVE: invalid write access at TIMA"
+ qemu_log_mask(LOG_GUEST_ERROR, "XIVE: invalid write access at TIMA
"
"@%"HWADDR_PRIx"\n", offset);
} else {
xto->write_handler(tctx, offset, value, size);
--
2.21.0
- [Qemu-devel] [PULL 15/42] spapr: Implement dispatch tracking for tcg, (continued)
- [Qemu-devel] [PULL 15/42] spapr: Implement dispatch tracking for tcg, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 12/42] ppc: fix memory leak in spapr_caps_add_properties, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 13/42] ppc: fix memory leak in spapr_dt_drc(), David Gibson, 2019/08/21
- [Qemu-devel] [PULL 14/42] ppc: fix leak in h_client_architecture_support, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 26/42] ppc/xive: Provide unconditional escalation support, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 18/42] spapr: Implement H_JOIN, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 33/42] spapr/pci: Consolidate de-allocation of MSIs, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 17/42] spapr: Implement H_CONFER, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 20/42] spapr: initial implementation for H_TPM_COMM/spapr-tpm-proxy, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 29/42] machine: Add wakeup method to MachineClass, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 23/42] ppc/xive: Implement TM_PULL_OS_CTX special command,
David Gibson <=
- [Qemu-devel] [PULL 34/42] spapr/pci: Free MSIs during reset, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 21/42] pseries: Update SLOF firmware image, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 37/42] spapr/xive: Mask the EAS when allocating an IRQ, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 25/42] ppc/xive: Provide escalation support, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 35/42] spapr/irq: Drop spapr_irq_msi_reset(), David Gibson, 2019/08/21
- [Qemu-devel] [PULL 28/42] ppc/xive: Improve 'info pic' support, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 36/42] spapr: Implement better workaround in spapr-vty device, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 38/42] target/ppc: Add Directed Privileged Door-bell Exception State (DPDES) SPR, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 30/42] i386: use machine class ->wakeup method, David Gibson, 2019/08/21
- [Qemu-devel] [PULL 22/42] ppc/xive: use an abstract type for XiveNotifier, David Gibson, 2019/08/21