mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
pnv/xive2: Check TIMA special ops against a dedicated array for P10
Accessing the TIMA from some specific ring/offset combination can trigger a special operation, with or without side effects. It is implemented in qemu with an array of special operations to compare accesses against. Since the presenter on P10 is pretty similar to P9, we had the full array defined for P9 and we just had a special case for P10 to treat one access differently. With a recent change,6f2cbd133d
("pnv/xive2: Handle TIMA access through all ports"), we now ignore some of the bits of the TIMA address, but that patch managed to botch the detection of the special case for P10. To clean that up, this patch introduces a full array of special ops to be used for P10. The code to detect a special access is common with P9, only the array of operations differs. The presenter can pick the correct array of special ops based on its configuration introduced in a previous patch. Fixes: Coverity CID 1512997, 1512998 Fixes:6f2cbd133d
("pnv/xive2: Handle TIMA access through all ports") Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
parent
2a24e6e394
commit
177835304b
2 changed files with 43 additions and 41 deletions
|
@ -1656,17 +1656,6 @@ static const MemoryRegionOps pnv_xive2_ic_tm_indirect_ops = {
|
|||
/*
|
||||
* TIMA ops
|
||||
*/
|
||||
|
||||
/*
|
||||
* Special TIMA offsets to handle accesses in a POWER10 way.
|
||||
*
|
||||
* Only the CAM line updates done by the hypervisor should be handled
|
||||
* specifically.
|
||||
*/
|
||||
#define HV_PAGE_OFFSET (XIVE_TM_HV_PAGE << TM_SHIFT)
|
||||
#define HV_PUSH_OS_CTX_OFFSET (HV_PAGE_OFFSET | (TM_QW1_OS + TM_WORD2))
|
||||
#define HV_PULL_OS_CTX_OFFSET (HV_PAGE_OFFSET | TM_SPC_PULL_OS_CTX)
|
||||
|
||||
static void pnv_xive2_tm_write(void *opaque, hwaddr offset,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
|
@ -1674,18 +1663,7 @@ static void pnv_xive2_tm_write(void *opaque, hwaddr offset,
|
|||
PnvXive2 *xive = pnv_xive2_tm_get_xive(cpu);
|
||||
XiveTCTX *tctx = XIVE_TCTX(pnv_cpu_state(cpu)->intc);
|
||||
XivePresenter *xptr = XIVE_PRESENTER(xive);
|
||||
bool gen1_tima_os =
|
||||
xive->cq_regs[CQ_XIVE_CFG >> 3] & CQ_XIVE_CFG_GEN1_TIMA_OS;
|
||||
|
||||
offset &= TM_ADDRESS_MASK;
|
||||
|
||||
/* TODO: should we switch the TM ops table instead ? */
|
||||
if (!gen1_tima_os && offset == HV_PUSH_OS_CTX_OFFSET) {
|
||||
xive2_tm_push_os_ctx(xptr, tctx, offset, value, size);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Other TM ops are the same as XIVE1 */
|
||||
xive_tctx_tm_write(xptr, tctx, offset, value, size);
|
||||
}
|
||||
|
||||
|
@ -1695,17 +1673,7 @@ static uint64_t pnv_xive2_tm_read(void *opaque, hwaddr offset, unsigned size)
|
|||
PnvXive2 *xive = pnv_xive2_tm_get_xive(cpu);
|
||||
XiveTCTX *tctx = XIVE_TCTX(pnv_cpu_state(cpu)->intc);
|
||||
XivePresenter *xptr = XIVE_PRESENTER(xive);
|
||||
bool gen1_tima_os =
|
||||
xive->cq_regs[CQ_XIVE_CFG >> 3] & CQ_XIVE_CFG_GEN1_TIMA_OS;
|
||||
|
||||
offset &= TM_ADDRESS_MASK;
|
||||
|
||||
/* TODO: should we switch the TM ops table instead ? */
|
||||
if (!gen1_tima_os && offset == HV_PULL_OS_CTX_OFFSET) {
|
||||
return xive2_tm_pull_os_ctx(xptr, tctx, offset, size);
|
||||
}
|
||||
|
||||
/* Other TM ops are the same as XIVE1 */
|
||||
return xive_tctx_tm_read(xptr, tctx, offset, size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue