target-arm queue
Subsystems (4)
Hi; here's an arm pullreq; pretty much all bugfixes this time.
thanks
-- PMM
The following changes since commit 5f664cd37aec17e8145aa117d8da68f507edc8f1:
Merge tag 'ui-pr-v1' of https://gitlab.com/marcandre.lureau/qemu into staging (2026-09-13 15:54:17 -1000)
are available in the Git repository at:
https://gitlab.com/pm215/qemu.git tags/pull-target-arm-20260915
for you to fetch changes up to 157f6c69edd0627f5f78f1f14ea0d831b0948c69:
target/arm: extend PMSAv7 support to v6-M CPUs (2026-09-15 14:27:23 +0100)
----------------------------------------------------------------
target-arm queue:
* target/arm/whpx: fix whpx-arm post-reset CPU state
* target/arm/whpx: incorrect ENCODE_AA64_CP_REG parameter order
* target/arm/whpx: Don't try to sync ARM_CP_CONST registers
* hw/intc/bcm2835_ic: reject out-of-range FIQ source values
* sbsa-gwdt: reschedule timer on direct WCV load
* target/arm/hvf: implement MDCCSR_EL0 as RAZ
* hw/char/stm32l4x5_usart: Accept character input upon RDR read
* MAINTAINERS: Update email address for Vikram Garhwal
* hw/misc/bcm2835_powermgt: free wdog timer on finalize
* target/arm: initialize SCTLR reset value for arm11mpcore
* target/arm: Fix various v6M corner-case bugs
----------------------------------------------------------------
Alex Bennée (1):
hw/char/stm32l4x5_usart: Accept character input upon RDR read
Bin Guo (1):
hw/intc/bcm2835_ic: reject out-of-range FIQ source values
Doug Cook (3):
target/arm/whpx: Don't try to sync ARM_CP_CONST registers target/arm/whpx: incorrect ENCODE_AA64_CP_REG parameter order target/arm/whpx: fix whpx-arm post-reset CPU state
Gilles Grimaud (5):
target/arm: enforce Armv6-M NVIC limits
target/arm: MPU - limit regs RBAR/RASR A1-A3 to Main Extension target/arm: MPU_RASR: mask TEX bits for Armv6-M target/arm: fix MPU SIZE min for v6-M/v7-M/v7-R target/arm: extend PMSAv7 support to v6-M CPUs
Igor Mammedov (6):
sbsa-gwdt: reduce code indent
arm: gwdt: consolidate clear WS0 and WS1 on explicit refresh
arm: gwdt: simplify WCV update condition
sbsa-gwdt: rename sbsa_gwdt_update_timer() to sbsa_gwdt_wor_update_timer()
sbsa-gwdt: don't arm timer for compare values above INT64_MAX
sbsa-gwdt: reschedule timer on direct WCV load
Marc-André Lureau (1):
hw/misc/bcm2835_powermgt: free wdog timer on finalize
Showta Ishizaki (1):
target/arm/hvf: implement MDCCSR_EL0 as RAZ
Vikram Garhwal (1):
MAINTAINERS: Update email address for Vikram Garhwal
vpyr (1):
target/arm: initialize SCTLR reset value for arm11mpcore
MAINTAINERS | 4 +- hw/char/stm32l4x5_usart.c | 1 + hw/intc/armv7m_nvic.c | 42 +++++- hw/intc/bcm2835_ic.c | 13 +- hw/misc/bcm2835_powermgt.c | 8 + hw/watchdog/sbsa_gwdt.c | 87 +++++++---- target/arm/cpu.c | 12 +- target/arm/hvf/hvf.c | 10 ++ target/arm/machine.c | 3 +- target/arm/ptw.c | 14 +- target/arm/tcg/cpu32.c | 1 + target/arm/whpx/whpx-all.c | 254 ++++++++++++++++++-------------- tests/qtest/bcm2835-ic-test.c | 66 +++++++++ tests/qtest/meson.build | 2 +- tests/tcg/arm/system/meson.build | 6 + tests/tcg/arm/system/test-armv6m-nvic.S | 70 +++++++++ 16 files changed, 439 insertions(+), 154 deletions(-) create mode 100644 tests/qtest/bcm2835-ic-test.c create mode 100644 tests/tcg/arm/system/test-armv6m-nvic.S
[PULL 06/20] arm: gwdt: consolidate clear WS0 and WS1 on explicit refresh
From: Igor Mammedov <[email protected]>
Current impl had logic scattered all over the place and WCS was implicitly cleared on WCS write.
Consolidate clear action in one place under EXPLICIT_REFRESH condition.
Message-id: [email protected]
--- hw/watchdog/sbsa_gwdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/watchdog/sbsa_gwdt.c +4 -4
@@ -105,6 +105,10 @@ static void sbsa_gwdt_update_timer(SBSA_GWDTState *s, WdtRefreshType rtype)timer_del (s->timer); +if (rtype ==EXPLICIT_REFRESH ) { + s->wcs &= ~(SBSA_GWDT_WCS_WS0 |SBSA_GWDT_WCS_WS1 ); + } +if (!(s->wcs &SBSA_GWDT_WCS_EN )) {return ; }
@@ -134,8 +138,6 @@ static void sbsa_gwdt_rwrite(void *opaque, hwaddr offset, uint64_t data,trace_sbsa_gwdt_refresh_write (offset, data);if (offset ==SBSA_GWDT_WRR ) { - s->wcs &= ~(SBSA_GWDT_WCS_WS0 |SBSA_GWDT_WCS_WS1 ); -sbsa_gwdt_update_timer (s,EXPLICIT_REFRESH ); }else { qemu_log_mask(LOG_GUEST_ERROR, "bad address in refresh frame write :"
@@ -157,14 +159,12 @@ static void sbsa_gwdt_write(void *opaque, hwaddr offset, uint64_t data,case SBSA_GWDT_WOR : s->worl = data; - s->wcs &= ~(SBSA_GWDT_WCS_WS0 |SBSA_GWDT_WCS_WS1 );qemu_set_irq (s->irq,0 );sbsa_gwdt_update_timer (s,EXPLICIT_REFRESH );break ;case SBSA_GWDT_WORU : s->woru = data &SBSA_GWDT_WOR_MASK ; - s->wcs &= ~(SBSA_GWDT_WCS_WS0 |SBSA_GWDT_WCS_WS1 );qemu_set_irq (s->irq,0 );sbsa_gwdt_update_timer (s,EXPLICIT_REFRESH );break ;
Signature · 1 line
2.43.0
[PULL 17/20] target/arm: MPU - limit regs RBAR/RASR A1-A3 to Main Extension
In reply to Peter MaydellFrom: Gilles Grimaud <[email protected]>
The alias registers MPU_RBAR_A1-A3 and MPU_RASR_A1-A3 (v7M) or MPU_RLAR_A1-A3 (v8M) exist only when the Main Extension is implemented (ARM_FEATURE_M_MAIN). The current NVIC decoder groups the principal register and its aliases in the same case fall-through, so once the PMSAv7 path is enabled for v6-M (or the PMSAv8 path for v8-M Baseline) the aliases become incorrectly accessible.
The fix reorders the case statements for the four locations (read and write of RBAR and RASR/RLAR) in hw/intc/armv7m_nvic.c. Alias cases are placed before the principal register case with a fall-through and are guarded by a test of ARM_FEATURE_M_MAIN. If the Main Extension is absent the code jumps to bad_offset, causing a read to log "NVIC: Bad read offset" and return zero, and a write to log "NVIC: Bad write offset" and be ignored. The principal MPU_RBAR and MPU_RASR/RLAR registers remain functional for CPUs that implement the corresponding MPU.
--- hw/intc/armv7m_nvic.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
hw/intc/armv7m_nvic.c +26 -4
@@ -1382,10 +1382,15 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)return cpu->env.v7m.mpu_ctrl[attrs.secure];case 0xd98 :/* MPU_RNR */ return cpu->env.pmsav7.rnr[attrs.secure]; -case 0xd9c :/* MPU_RBAR */ case 0xda4 :/* MPU_RBAR_A1 */ case 0xdac :/* MPU_RBAR_A2 */ case 0xdb4 :/* MPU_RBAR_A3 */ +if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { +/* These aliases are not present for v6M or v8M without Main */ + goto bad_offset; + } +/* fall through */ +case 0xd9c :/* MPU_RBAR */ {int region = cpu->env.pmsav7.rnr[attrs.secure];
@@ -1410,10 +1415,16 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) }return (cpu->env.pmsav7.drbar[region] & ~0x1f ) | (region &0xf ); } -case 0xda0 :/* MPU_RASR (v7M), MPU_RLAR (v8M) */ +case 0xda8 :/* MPU_RASR_A1 (v7M), MPU_RLAR_A1 (v8M) */ case 0xdb0 :/* MPU_RASR_A2 (v7M), MPU_RLAR_A2 (v8M) */ case 0xdb8 :/* MPU_RASR_A3 (v7M), MPU_RLAR_A3 (v8M) */ +if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { +/* These aliases are not present for v6M or v8M without Main */ + goto bad_offset; + } +/* fall through */ +case 0xda0 :/* MPU_RASR (v7M), MPU_RLAR (v8M) */ {int region = cpu->env.pmsav7.rnr[attrs.secure];
@@ -1892,10 +1903,15 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, cpu->env.pmsav7.rnr[attrs.secure] = value; }break ; -case 0xd9c :/* MPU_RBAR */ case 0xda4 :/* MPU_RBAR_A1 */ case 0xdac :/* MPU_RBAR_A2 */ case 0xdb4 :/* MPU_RBAR_A3 */ +if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { +/* These aliases are not present for v6M or v8M without Main */ + goto bad_offset; + } +/* fall through */ +case 0xd9c :/* MPU_RBAR */ {int region;
@@ -1943,10 +1959,16 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value,tlb_flush (CPU (cpu));break ; } -case 0xda0 :/* MPU_RASR (v7M), MPU_RLAR (v8M) */ +case 0xda8 :/* MPU_RASR_A1 (v7M), MPU_RLAR_A1 (v8M) */ case 0xdb0 :/* MPU_RASR_A2 (v7M), MPU_RLAR_A2 (v8M) */ case 0xdb8 :/* MPU_RASR_A3 (v7M), MPU_RLAR_A3 (v8M) */ +if (!arm_feature (&cpu->env,ARM_FEATURE_M_MAIN )) { +/* These aliases are not present for v6M or v8M without Main */ + goto bad_offset; + } +/* fall through */ +case 0xda0 :/* MPU_RASR (v7M), MPU_RLAR (v8M) */ {int region = cpu->env.pmsav7.rnr[attrs.secure];
Signature · 1 line
2.43.0
[PULL 12/20] hw/char/stm32l4x5_usart: Accept character input upon RDR read
In reply to Peter MaydellFrom: Alex Bennée <[email protected]>
Looking through existing serial devices this seems to be a common pattern so it makes sense to me this is the right fix and matches the API description.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4389
Message-id: [email protected]
AI-used-for: fetch issue, apply proposed patch, verify build and qtests
--- hw/char/stm32l4x5_usart.c | 1 + 1 file changed, 1 insertion(+)
hw/char/stm32l4x5_usart.c +1 -0
@@ -441,6 +441,7 @@ static uint64_t stm32l4x5_usart_base_read(void *opaque, hwaddr addr,/* Reset RXNE flag */ s->isr &= ~R_ISR_RXNE_MASK ;stm32l4x5_update_irq (s); +qemu_chr_fe_accept_input (&s->chr);break ;case A_TDR : retvalue =FIELD_EX32 (s->tdr,TDR ,TDR );
Signature · 1 line
2.43.0
[PULL 11/20] target/arm/hvf: implement MDCCSR_EL0 as RAZ
In reply to Peter MaydellFrom: Showta Ishizaki <[email protected]>
A guest that reads MDCCSR_EL0 under hvf is killed. The register has no case in hvf_sysreg_read(), so it reaches the unhandled path and hvf injects an undefined instruction:
trace_hvf_unhandled_sysreg_read(env->pc, reg, ...);
hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1);The TCG path does not do this. debug_helper.c defines MDCCSR_EL0 as ARM_CP_CONST with resetvalue 0, and the comment on the neighbouring DCC registers gives the reason:
However we implement RAZ/WI behaviour with trapping to prevent spurious SIGILLs if the guest OS does access them as the support cannot be probed for.
That argument holds for hvf as much as for TCG, so do the same there.
The read only reaches QEMU since 37863fff59 ("hvf: arm: enable vGIC by default for virt-11.1 and later"). With -M virt,kernel-irqchip=off the trace point does not fire at all, so before that change the register was never trapped out.
NetBSD/aarch64 hits this on every boot. vmt(4) probes for the VMware backdoor, which on arm64 is a read of MDCCSR_EL0 with a magic value in x7, and the injected undefined instruction is fatal in kernel mode:
[ 1.0000000] cpu0 at acpi0: unknown CPU (ID = 0x610f0000), id 0x0
[ 1.0000000] panic: Trap: fatal Unknown Reason (Illegal Instruction):
pc=ffffc000003fa318 sp=ffffc000010262e0 esr=02000000
[ 1.0000000] fp ffffc000010262f0 vmt_probe() at netbsd:vmt_probe+0x3c
[ 1.0000000] fp ffffc00001026340 vmt_match() at netbsd:vmt_match+0x1cThe pc in the panic is the same pc the trace point reports, and the encoding it reports is MDCCSR_EL0:
hvf_unhandled_sysreg_read unhandled sysreg read at pc=0xffffc000003fa318:
0x0020c002 (op0=2 op1=3 crn=0 crm=1 op2=0)With this patch the same image boots to login on -M virt -accel hvf, and the trace point does not fire.
Message-id: [email protected]
--- target/arm/hvf/hvf.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
target/arm/hvf/hvf.c +10 -0
@@ -234,6 +234,7 @@ void hvf_arm_init_debug(void)#define SYSREG_ICC_SRE_EL1 SYSREG(3, 0, 12, 12, 5)#define SYSREG_MDSCR_EL1 SYSREG(2, 0, 0, 2, 2) +#define SYSREG_MDCCSR_EL0 SYSREG(2, 3, 0, 1, 0)#define SYSREG_DBGBVR0_EL1 SYSREG(2, 0, 0, 0, 4)#define SYSREG_DBGBCR0_EL1 SYSREG(2, 0, 0, 0, 5)#define SYSREG_DBGWVR0_EL1 SYSREG(2, 0, 0, 0, 6)
@@ -1756,6 +1757,15 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t reg, uint64_t *val)case SYSREG_MDCCINT_EL1 :assert_hvf_ok (hv_vcpu_get_sys_reg (cpu->accel->fd,HV_SYS_REG_MDCCINT_EL1 , val));return 0 ; +case SYSREG_MDCCSR_EL0 : +/* +* The Debug Communications Channel is not implemented, so RAZ, +* which is what the TCG path in debug_helper.c does. A guest +* cannot probe for DCC support, so injecting an undefined +* instruction here turns a legal read into a fatal trap. +*/ + *val =0 ; +return 0 ;case SYSREG_ICC_AP0R0_EL1 :case SYSREG_ICC_AP0R1_EL1 :case SYSREG_ICC_AP0R2_EL1 :
Signature · 1 line
2.43.0
[PULL 19/20] target/arm: fix MPU SIZE min for v6-M/v7-M/v7-R
In reply to Peter MaydellFrom: Gilles Grimaud <[email protected]>
The PMSAv7 walk accepted any non-zero region size field, but Armv6-M requires a minimum of 7 (256 B), Armv7-M requires 4 (32 B) and v7-R retains its current minimum of 1 (4 B). Introduce rsize_min based on ARM_FEATURE_M and ARM_FEATURE_V7 and reject smaller values. The PMSAv8 path is handled earlier and remains unchanged.
--- target/arm/ptw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
target/arm/ptw.c +9 -2
@@ -2720,6 +2720,11 @@ static bool get_phys_addr_pmsav7(CPUARMState *env,ARMMMUIdx mmu_idx = ptw->in_mmu_idx;bool is_user =regime_is_user (mmu_idx);bool secure =arm_space_is_secure (ptw->in_space); +uint32_t rsize_min =1 ; + +if (arm_feature (env,ARM_FEATURE_M )) { + rsize_min =arm_feature (env,ARM_FEATURE_V7 ) ?4 :7 ; + } result->f.phys_addr = address; result->f.lg_page_size =TARGET_PAGE_BITS ;
@@ -2748,11 +2753,13 @@ static bool get_phys_addr_pmsav7(CPUARMState *env,continue ; } -if (!rsize) { +if (rsize < rsize_min) {qemu_log_mask (LOG_GUEST_ERROR , -"DRSR[%d]: Rsize field cannot be 0\n" , n); +"DRSR[%d]: invalid Rsize field 0x%x\n" , + n, rsize);continue ; } + rsize++; rmask = (1ull << rsize) -1 ;
Signature · 1 line
2.43.0
[PULL 20/20] target/arm: extend PMSAv7 support to v6-M CPUs
In reply to Peter MaydellFrom: Gilles Grimaud <[email protected]>
QEMU conditions PMSAv7 storage, reset, allocation, the pmsav7-dregion property, migration and address translation on ARM_FEATURE_V7, which prevents the Armv6-M MPU from being used. The checks are widened to also accept ARM_FEATURE_M while preserving the PMSAv8 path for v8-M CPUs (PMSAv8 is tested first and the migration vmstate excludes v8-M with !ARM_FEATURE_V8). This lets a Cortex-M0+ declare and use its MPU regions without setting ARM_FEATURE_V7, while v8-M CPUs continue to use PMSAv8 storage and migration.
--- target/arm/cpu.c | 12 +++++++++--- target/arm/machine.c | 3 ++- target/arm/ptw.c | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-)
target/arm/cpu.c +9 -3
@@ -617,7 +617,8 @@ static void arm_cpu_reset_hold(Object *obj, ResetType type)sizeof (*env->pmsav8.rlar[M_REG_S ]) * cpu->pmsav7_dregion); } - }else if (arm_feature (env,ARM_FEATURE_V7 )) { + }else if (arm_feature (env,ARM_FEATURE_V7 ) || +arm_feature (env,ARM_FEATURE_M )) {memset (env->pmsav7.drbar,0 ,sizeof (*env->pmsav7.drbar) * cpu->pmsav7_dregion); memset(env->pmsav7.drsr, 0,
@@ -1656,7 +1657,11 @@ static void arm_cpu_post_init(Object *obj)#ifndef CONFIG_USER_ONLY if (arm_feature (&cpu->env,ARM_FEATURE_PMSA )) {qdev_property_add_static (DEVICE (obj), &arm_cpu_has_mpu_property); -if (arm_feature (&cpu->env,ARM_FEATURE_V7 )) { +/* +* QEMU's PMSAv7 state also models the Armv6-M MPU register layout. +*/ +if (arm_feature (&cpu->env,ARM_FEATURE_V7 ) || +arm_feature (&cpu->env,ARM_FEATURE_M )) {qdev_property_add_static (DEVICE (obj), &arm_cpu_pmsav7_dregion_property); }
@@ -2332,7 +2337,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) }if (arm_feature (env,ARM_FEATURE_PMSA ) && -arm_feature (env,ARM_FEATURE_V7 )) { + (arm_feature (env,ARM_FEATURE_V7 ) || +arm_feature (env,ARM_FEATURE_M ))) {uint32_t nr = cpu->pmsav7_dregion;if (nr >0xff ) {
target/arm/machine.c +2 -1
@@ -584,7 +584,8 @@ static bool pmsav7_needed(void *opaque)CPUARMState *env = &cpu->env;return arm_feature (env,ARM_FEATURE_PMSA ) && -arm_feature (env,ARM_FEATURE_V7 ) && + (arm_feature (env,ARM_FEATURE_V7 ) || +arm_feature (env,ARM_FEATURE_M )) && !arm_feature (env,ARM_FEATURE_V8 ); }
target/arm/ptw.c +2 -1
@@ -3908,7 +3908,8 @@ static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,/* PMSAv8 */ ret =get_phys_addr_pmsav8 (env, ptw, address, access_type, result, fi); - }else if (arm_feature (env,ARM_FEATURE_V7 )) { + }else if (arm_feature (env,ARM_FEATURE_V7 ) || +arm_feature (env,ARM_FEATURE_M )) {/* PMSAv7 */ ret =get_phys_addr_pmsav7 (env, ptw, address, access_type, result, fi);
Signature · 1 line
2.43.0
[PULL 08/20] sbsa-gwdt: rename sbsa_gwdt_update_timer() to sbsa_gwdt_wor_update_timer()
In reply to Peter MaydellFrom: Igor Mammedov <[email protected]>
The timer update helper computes the timeout from the WOR (watchdog offset register). Rename it to sbsa_gwdt_wor_update_timer() to make room for a separate WCV-based update helper added by a following patch.
No functional change.
Message-id: [email protected]
--- hw/watchdog/sbsa_gwdt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/watchdog/sbsa_gwdt.c +6 -6
@@ -99,7 +99,7 @@ static uint64_t sbsa_gwdt_read(void *opaque, hwaddr addr, unsigned int size)return ret; } -static void sbsa_gwdt_update_timer (SBSA_GWDTState *s,WdtRefreshType rtype) +static void sbsa_gwdt_wor_update_timer (SBSA_GWDTState *s,WdtRefreshType rtype) {uint64_t timeout =0 ;
@@ -144,7 +144,7 @@ static void sbsa_gwdt_rwrite(void *opaque, hwaddr offset, uint64_t data,trace_sbsa_gwdt_refresh_write (offset, data);if (offset ==SBSA_GWDT_WRR ) { -sbsa_gwdt_update_timer (s,EXPLICIT_REFRESH ); +sbsa_gwdt_wor_update_timer (s,EXPLICIT_REFRESH ); }else {qemu_log_mask (LOG_GUEST_ERROR ,"bad address in refresh frame write :" " 0x%x\n" , (int )offset);
@@ -160,19 +160,19 @@ static void sbsa_gwdt_write(void *opaque, hwaddr offset, uint64_t data,case SBSA_GWDT_WCS : s->wcs = data &SBSA_GWDT_WCS_EN ;qemu_set_irq (s->irq,0 ); -sbsa_gwdt_update_timer (s,EXPLICIT_REFRESH ); +sbsa_gwdt_wor_update_timer (s,EXPLICIT_REFRESH );break ;case SBSA_GWDT_WOR : s->worl = data;qemu_set_irq (s->irq,0 ); -sbsa_gwdt_update_timer (s,EXPLICIT_REFRESH ); +sbsa_gwdt_wor_update_timer (s,EXPLICIT_REFRESH );break ;case SBSA_GWDT_WORU : s->woru = data &SBSA_GWDT_WOR_MASK ;qemu_set_irq (s->irq,0 ); -sbsa_gwdt_update_timer (s,EXPLICIT_REFRESH ); +sbsa_gwdt_wor_update_timer (s,EXPLICIT_REFRESH );break ;case SBSA_GWDT_WCV :
@@ -211,7 +211,7 @@ static void sbsa_gwdt_timer_sysinterrupt(void *opaque)if (!(s->wcs &SBSA_GWDT_WCS_WS0 )) { s->wcs |=SBSA_GWDT_WCS_WS0 ;trace_sbsa_gwdt_ws0_asserted (); -sbsa_gwdt_update_timer (s,TIMEOUT_REFRESH ); +sbsa_gwdt_wor_update_timer (s,TIMEOUT_REFRESH );qemu_set_irq (s->irq,1 ); }else { s->wcs |=SBSA_GWDT_WCS_WS1 ;
Signature · 1 line
2.43.0
[PULL 01/20] target/arm/whpx: Don't try to sync ARM_CP_CONST registers
In reply to Peter MaydellFrom: Doug Cook <[email protected]>
ARM_CP_CONST registers ignore writes, so readback assertion fails.
Not asserting now because all entries in the whpx_sreg_match table are invalid. Needs to be fixed now so that we can fix the table entries.
--- target/arm/whpx/whpx-all.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
target/arm/whpx/whpx-all.c +4 -1
@@ -223,6 +223,8 @@ static struct whpx_sreg_match whpx_sreg_match[] = { { WHvArm64RegisterMpidrEl1, ENCODE_AA64_CP_REG(0, 0, 3, 0, 5) }, { WHvArm64RegisterIdPfr0El1, ENCODE_AA64_CP_REG(0, 4, 3, 0, 0) }, #endif +#ifdef SYNC_CONST_ID_REGS + /* ID registers are ARM_CP_CONST (writes ignored). */ { WHvArm64RegisterIdAa64Pfr1El1, ENCODE_AA64_CP_REG(0, 4, 3, 0, 1), true }, { WHvArm64RegisterIdAa64Dfr0El1, ENCODE_AA64_CP_REG(0, 5, 3, 0, 0), true }, { WHvArm64RegisterIdAa64Dfr1El1, ENCODE_AA64_CP_REG(0, 5, 3, 0, 1), true },
@@ -235,6 +237,7 @@ static struct whpx_sreg_match whpx_sreg_match[] = { { WHvArm64RegisterIdAa64Mmfr1El1, ENCODE_AA64_CP_REG(0, 7, 3, 0, 1), true }, { WHvArm64RegisterIdAa64Mmfr2El1, ENCODE_AA64_CP_REG(0, 7, 3, 0, 2), true }, { WHvArm64RegisterIdAa64Mmfr3El1, ENCODE_AA64_CP_REG(0, 7, 3, 0, 3), true }, +#endif { WHvArm64RegisterMdscrEl1, ENCODE_AA64_CP_REG(0, 2, 2, 0, 2) }, { WHvArm64RegisterSctlrEl1, ENCODE_AA64_CP_REG(1, 0, 3, 0, 0) },
@@ -790,7 +793,7 @@ int whpx_init_vcpu(CPUState *cpu) ri =get_arm_cp_reginfo (arm_cpu->cp_regs, key);if (ri) { -assert (!(ri->type &ARM_CP_NO_RAW )); +assert (!(ri->type & (ARM_CP_NO_RAW |ARM_CP_CONST ))); whpx_sreg_match[i].cp_idx = sregs_cnt; arm_cpu->cpreg_indexes[sregs_cnt++] =cpreg_to_kvm_id (key); }else {
Signature · 1 line
2.43.0
[PULL 18/20] target/arm: MPU_RASR: mask TEX bits for Armv6-M
In reply to Peter MaydellFrom: Gilles Grimaud <[email protected]>
Keep the existing mask (0x173f) for CPUs with ARM_FEATURE_V7, and use a mask that excludes TEX (0x1707) for Armv6-M. PMSAv8 is handled by the earlier branch and is unaffected by this change.
After writing MPU_RASR on an Armv6-M CPU a subsequent read returns zero for the TEX bits; Armv7-M behaviour remains unchanged.
--- hw/intc/armv7m_nvic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
hw/intc/armv7m_nvic.c +6 -1
@@ -1996,7 +1996,12 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, } cpu->env.pmsav7.drsr[region] = value &0xff3f ; - cpu->env.pmsav7.dracr[region] = (value >>16 ) &0x173f ; +if (arm_feature (&cpu->env,ARM_FEATURE_V7 )) { + cpu->env.pmsav7.dracr[region] = (value >>16 ) &0x173f ; + }else { +/* Armv6-M has XN, AP, S, C and B, but no TEX field. */ + cpu->env.pmsav7.dracr[region] = (value >>16 ) &0x1707 ; + }tlb_flush (CPU (cpu));break ; }
Signature · 1 line
2.43.0
[PULL 03/20] target/arm/whpx: fix whpx-arm post-reset CPU state
In reply to Peter MaydellFrom: Doug Cook <[email protected]>
Reset should leave CPU 0 running, and should leave all other CPUs suspended. Instead, no CPUs are suspended and CPUs may be left in low-power states.
Fix by updating state in whpx_set_registers WHPX_LEVEL_RESET_STATE.
--- target/arm/whpx/whpx-all.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
target/arm/whpx/whpx-all.c +31 -0
@@ -613,6 +613,37 @@ void whpx_set_registers(CPUState *cpu, WHPXStateLevel level)whpx_set_reg (cpu, whpx_sreg_match[i].reg, val); } } + +if (level ==WHPX_LEVEL_RESET_STATE ) { +/* +* WHPX keeps the "vCPU is in a low-power wait" state (entered when the +* guest executes WFI/WFE) in WHvRegisterInternalActivityState, and that +* state is not affected by writing the architectural registers above. +* If the guest happened to be idle when the reset was requested, the +* vCPU would stay suspended forever. +* +* StartupSuspend is the bit WHP uses to hold a vCPU that has not been +* started yet, and it is how secondary vCPUs are parked until PSCI +* CPU_ON releases them. +*/ +WHV_REGISTER_NAME name = WHvRegisterInternalActivityState; +bool powered_off = arm_cpu->power_state ==PSCI_OFF ; +WHV_REGISTER_VALUE ia; +HRESULT hr; + +clean_whv_register_value (&ia); + hr = whp_dispatch.WHvGetVirtualProcessorRegisters ( + whpx_global.partition, cpu->cpu_index, &name,1 , &ia); +if (SUCCEEDED (hr) && + (ia.InternalActivity.IdleSuspend || + ia.InternalActivity.HaltSuspend || + ia.InternalActivity.StartupSuspend != powered_off)) { + ia.InternalActivity.IdleSuspend =0 ; + ia.InternalActivity.HaltSuspend =0 ; + ia.InternalActivity.StartupSuspend = powered_off; +whpx_set_reg (cpu, WHvRegisterInternalActivityState, ia); + } + } }static uint32_t max_vcpu_index;
Signature · 1 line
2.43.0
[PULL 09/20] sbsa-gwdt: don't arm timer for compare values above INT64_MAX
In reply to Peter MaydellFrom: Igor Mammedov <[email protected]>
QEMU timer subsystem uses int64_t, so a WCV value with bit 63 set would overflow and cause the timer to fire immediately. The SBSA spec defines WCV as an unsigned 64-bit compare value, so such values are valid per spec and represent far-future deadlines (however unpractical).
The current code is not affected: WCV writes don't reschedule the timer yet, so a guest-supplied compare value never reaches the timer API. The follow-up patch ("sbsa-gwdt: reschedule timer on direct WCV load") changes that, at which point an out-of-range WCV would overflow the timer. For example, Windows in GTDT mode writes WCV in two 32-bit halves while the watchdog is running:
sbsa-gwdt_control_write [0x8] <- 0xffffffff # WOR (~4 sec) sbsa-gwdt_control_write [0x0] <- 0x1 # WCS enable sbsa-gwdt_control_write [0x14] <- 0xffffffff # WCVU (intermediate) sbsa-gwdt_control_write [0x10] <- 0xa906ca28 # WCVL sbsa-gwdt_control_write [0x14] <- 0xecb1 # WCVU (final)
The intermediate WCVU write (0xffffffff) yields a WCV above INT64_MAX; once WCV writes arm the timer, this overflows QEMU's signed timer and fires immediately -- triggering WS0 => WS1 => reboot before the final WCVU write lands.
Add the guard first, before the WCV rescheduling patch, so the tree stays bisectable. Instead of arming the timer with an unsupported deadline, leave it disarmed. This reuses hw/timer/sse-timer.c:sse_set_timer() (commit 0b8ceee822 "hw/timer/sse-timer: Model the SSE Subsystem System Timer").
Introduce a sbsa_gwdt_set_timer() helper for this and route the WOR-based timeout through it.
Message-id: [email protected]
--- hw/watchdog/sbsa_gwdt.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
hw/watchdog/sbsa_gwdt.c +17 -1
@@ -99,6 +99,22 @@ static uint64_t sbsa_gwdt_read(void *opaque, hwaddr addr, unsigned int size)return ret; } +static void sbsa_gwdt_set_timer (SBSA_GWDTState *s,uint64_t deadline) +{ +/* +* WCV is an unsigned 64-bit compare value, but QEMUTimer stores the +* expiry as a signed int64_t. A deadline with bit 63 set would be seen +* as already expired and fire the watchdog immediately. Such a deadline +* is unreachable within any guest runtime, so treat it as "never" and +* leave the timer disarmed instead. +*/ +if (deadline <=INT64_MAX ) { +timer_mod (s->timer, deadline); + }else { +timer_del (s->timer); + } +} +static void sbsa_gwdt_wor_update_timer (SBSA_GWDTState *s,WdtRefreshType rtype) {uint64_t timeout =0 ;
@@ -135,7 +151,7 @@ static void sbsa_gwdt_wor_update_timer(SBSA_GWDTState *s, WdtRefreshType rtype) s->wcvu = timeout >>32 ; s->wcvl = timeout; -timer_mod (s->timer, timeout); +sbsa_gwdt_set_timer (s, timeout); } static void sbsa_gwdt_rwrite(void *opaque, hwaddr offset, uint64_t data,
Signature · 1 line
2.43.0
[PULL 04/20] hw/intc/bcm2835_ic: reject out-of-range FIQ source values
In reply to Peter MaydellFrom: Bin Guo <[email protected]>
The FIQ_CONTROL register accepts a 7-bit source selector, but only sources 0..71 (64 GPU + 8 ARM IRQs) exist. Values 96..127 cause bcm2835_ic_update() to call extract32(arm_irq_level, start, 1) with start >= 32, which trips the assertion in bitops.h and aborts QEMU.
Reject writes that select a non-existent source and log a guest error, so that a malicious or buggy guest cannot kill the emulator.
Add a qtest that verifies both valid and out-of-range FIQ source selections on raspi3b.
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4368
Message-id: [email protected]
--- hw/intc/bcm2835_ic.c | 13 +++++-- tests/qtest/bcm2835-ic-test.c | 66 +++++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 2 +- 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 tests/qtest/bcm2835-ic-test.c
hw/intc/bcm2835_ic.c +11 -2
@@ -139,10 +139,19 @@ static void bcm2835_ic_write(void *opaque, hwaddr offset, uint64_t val,BCM2835ICState *s = opaque;switch (offset) { -case FIQ_CONTROL : - s->fiq_select =extract32 (val,0 ,7 ); +case FIQ_CONTROL : { +unsigned fiq_select =extract32 (val,0 ,7 ); + +if (fiq_select >=GPU_IRQS +ARM_IRQS ) { +qemu_log_mask (LOG_GUEST_ERROR , +"%s: FIQ select %u out of range\n" , + __func__, fiq_select); +return ; + } + s->fiq_select = fiq_select; s->fiq_enable =extract32 (val,7 ,1 );break ; + }case IRQ_ENABLE_1 : s->gpu_irq_enable |= val;break ;
tests/qtest/bcm2835-ic-test.c new file +66 -0
66 lines not on this page · raw message
tests/qtest/meson.build +1 -1
@@ -277,7 +277,7 @@ qtests_aarch64 = \ ['tpm-tis-device-test', 'tpm-tis-device-swtpm-test'] : []) + \ (config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test', 'fuzz-xlnx-dp-test'] : []) + \ (config_all_devices.has_key('CONFIG_XLNX_VERSAL') ? ['xlnx-canfd-test', 'xlnx-versal-trng-test'] : []) + \ - (config_all_devices.has_key('CONFIG_RASPI') ? ['bcm2835-dma-test', 'bcm2835-i2c-test'] : []) + \ + (config_all_devices.has_key('CONFIG_RASPI') ? ['bcm2835-dma-test', 'bcm2835-i2c-test', 'bcm2835-ic-test'] : []) + \ (config_all_accel.has_key('CONFIG_TCG') and \ config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test', 'tpm-tis-i2c-swtpm-test'] : []) + \ (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed64 : []) + \
Signature · 1 line
2.43.0
[PULL 05/20] sbsa-gwdt: reduce code indent
In reply to Peter MaydellFrom: Igor Mammedov <[email protected]>
Message-id: [email protected]
--- hw/watchdog/sbsa_gwdt.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-)
hw/watchdog/sbsa_gwdt.c +20 -18
@@ -105,25 +105,27 @@ static void sbsa_gwdt_update_timer(SBSA_GWDTState *s, WdtRefreshType rtype)timer_del (s->timer); -if (s->wcs &SBSA_GWDT_WCS_EN ) { -/* -* Extract the upper 16 bits from woru & 32 bits from worl -* registers to construct the 48 bit offset value -*/ - timeout = s->woru; - timeout <<=32 ; - timeout |= s->worl; - timeout =muldiv64 (timeout,NANOSECONDS_PER_SECOND , s->freq); - timeout +=qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ); - -if ((rtype ==EXPLICIT_REFRESH ) || ((rtype ==TIMEOUT_REFRESH ) && - (!(s->wcs &SBSA_GWDT_WCS_WS0 )))) { -/* store the current timeout value into compare registers */ - s->wcvu = timeout >>32 ; - s->wcvl = timeout; - } -timer_mod (s->timer, timeout); +if (!(s->wcs &SBSA_GWDT_WCS_EN )) { +return ; } + +/* +* Extract the upper 16 bits from woru & 32 bits from worl +* registers to construct the 48 bit offset value +*/ + timeout = s->woru; + timeout <<=32 ; + timeout |= s->worl; + timeout =muldiv64 (timeout,NANOSECONDS_PER_SECOND , s->freq); + timeout +=qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ); + +if ((rtype ==EXPLICIT_REFRESH ) || ((rtype ==TIMEOUT_REFRESH ) && + (!(s->wcs &SBSA_GWDT_WCS_WS0 )))) { +/* store the current timeout value into compare registers */ + s->wcvu = timeout >>32 ; + s->wcvl = timeout; + } +timer_mod (s->timer, timeout); } static void sbsa_gwdt_rwrite(void *opaque, hwaddr offset, uint64_t data,
Signature · 1 line
2.43.0
[PULL 07/20] arm: gwdt: simplify WCV update condition
In reply to Peter MaydellFrom: Igor Mammedov <[email protected]>
Current code implements SBSA 5.0, revision 1 of the generic watchdog. Which requires WCV retain time when WS1 was triggered.
towards that effect sbsa_gwdt_update_timer(), used condition
(rtype == TIMEOUT_REFRESH) && !(s->wcs & SBSA_GWDT_WCS_WS0)
to make sure that WCV won't be updated on WS1.
However that is dead code as sbsa_gwdt_timer_sysinterrupt() when signalling WS1, never calls sbsa_gwdt_update_timer().
Delete dead condition and add assert to make sure that sbsa_gwdt_update_timer() is never called unnoticed on WS1 path.
Above change leaves us with always true remaining if condition:
(rtype == EXPLICIT_REFRESH) || (rtype == TIMEOUT_REFRESH)
drop it and update WCV unconditionaly.
Message-id: [email protected]
--- hw/watchdog/sbsa_gwdt.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
hw/watchdog/sbsa_gwdt.c +12 -6
@@ -123,12 +123,18 @@ static void sbsa_gwdt_update_timer(SBSA_GWDTState *s, WdtRefreshType rtype) timeout =muldiv64 (timeout,NANOSECONDS_PER_SECOND , s->freq); timeout +=qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ); -if ((rtype ==EXPLICIT_REFRESH ) || ((rtype ==TIMEOUT_REFRESH ) && - (!(s->wcs &SBSA_GWDT_WCS_WS0 )))) { -/* store the current timeout value into compare registers */ - s->wcvu = timeout >>32 ; - s->wcvl = timeout; - } +/* +* We only call this function for an explicit refresh (which +* clears WS0 and WS1) or after the first timeout setting WS0; +* so we can always load the compare registers with the new +* timeout value (which is not permitted when the second timeout +* that sets WS1 happens). +*/ +g_assert (!(s->wcs &SBSA_GWDT_WCS_WS1 )); + + s->wcvu = timeout >>32 ; + s->wcvl = timeout; +timer_mod (s->timer, timeout); }
Signature · 1 line
2.43.0
[PULL 14/20] hw/misc/bcm2835_powermgt: free wdog timer on finalize
In reply to Peter MaydellFrom: Marc-André Lureau <[email protected]>
The wdog_timer allocated in instance_init is causing ASAN to report a leak when the object is destroyed (e.g. during qom-test and device-introspect-test).
Add an instance_finalize handler to free it.
--- hw/misc/bcm2835_powermgt.c | 8 ++++++++ 1 file changed, 8 insertions(+)
hw/misc/bcm2835_powermgt.c +8 -0
@@ -152,6 +152,13 @@ static void bcm2835_powermgt_init(Object *obj) bcm2835_powermgt_expire, s); } +static void bcm2835_powermgt_finalize (Object *obj) +{ +BCM2835PowerMgtState *s =BCM2835_POWERMGT (obj); + +timer_free (s->wdog_timer); +} +static void bcm2835_powermgt_reset (DeviceState *dev) {BCM2835PowerMgtState *s =BCM2835_POWERMGT (dev);
@@ -177,6 +184,7 @@ static const TypeInfo bcm2835_powermgt_info = { .instance_size = sizeof(BCM2835PowerMgtState), .class_init = bcm2835_powermgt_class_init, .instance_init = bcm2835_powermgt_init, + .instance_finalize = bcm2835_powermgt_finalize, };static void bcm2835_powermgt_register_types (void )
Signature · 1 line
2.43.0
[PULL 10/20] sbsa-gwdt: reschedule timer on direct WCV load
In reply to Peter MaydellFrom: Igor Mammedov <[email protected]>
According to spec[1]:
"The compare value can either be loaded directly or indirectly on an
explicit refresh or timeout refresh"
QEMU accepts writes to WCV but doesn't reschedule the timer, which it should per the spec pseudo code:
"TimeoutRefresh = ( SystemCounter [63:0] > CompareValue [63:0])"
Fix it by updating the timer on WCV write.
partialy[2] fixes Windows in GTDT mode, which never issues a WRR refresh. Instead, it programs WOR to ~4 sec, enables WCS, and immediately writes a large absolute value into WCV to push the timeout far into the future. Without this, QEMU ignores the WCV write, the short WOR expires, and the guest reboots unexpectedly.
1) Arm® Server Base System Architecture 6.0
Platform Design Document
DEN0029D 6.0
"A.2 Watchdog Operation"
2) under KVM system counter (CNTPCT) as read by guest apprears to produce host's value, so watchdog timeout effectively gets extended on host uptime offset. But that's a separate issue to be fixed.
Message-id: [email protected]
--- hw/watchdog/sbsa_gwdt.c | 9 +++++++++ 1 file changed, 9 insertions(+)
hw/watchdog/sbsa_gwdt.c +9 -0
@@ -154,6 +154,13 @@ static void sbsa_gwdt_wor_update_timer(SBSA_GWDTState *s, WdtRefreshType rtype)sbsa_gwdt_set_timer (s, timeout); } +static void sbsa_gwdt_wcv_update_timer (SBSA_GWDTState *s) +{ +if (s->wcs &SBSA_GWDT_WCS_EN ) { +sbsa_gwdt_set_timer (s, (uint64_t )s->wcvu <<32 | s->wcvl); + } +} +static void sbsa_gwdt_rwrite (void *opaque,hwaddr offset,uint64_t data,unsigned size) {SBSA_GWDTState *s =SBSA_GWDT (opaque);
@@ -193,10 +200,12 @@ static void sbsa_gwdt_write(void *opaque, hwaddr offset, uint64_t data,case SBSA_GWDT_WCV : s->wcvl = data; +sbsa_gwdt_wcv_update_timer (s);break ;case SBSA_GWDT_WCVU : s->wcvu = data; +sbsa_gwdt_wcv_update_timer (s);break ;default :
Signature · 1 line
2.43.0
[PULL 13/20] MAINTAINERS: Update email address for Vikram Garhwal
In reply to Peter MaydellFrom: Vikram Garhwal <[email protected]>
--- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
MAINTAINERS +2 -2
@@ -2177,7 +2177,7 @@ F: tests/qtest/fuzz-sb16-test.c Xilinx CAN M: Francisco Iglesias <[email protected]> -M: Vikram Garhwal <[email protected]> +M: Vikram Garhwal <[email protected]> S: Maintained F: hw/net/can/xlnx-* F: include/hw/net/xlnx-*
@@ -3047,7 +3047,7 @@ F: include/hw/rx/ CAN bus subsystem and hardware M: Pavel Pisa <[email protected]> M: Francisco Iglesias <[email protected]> -M: Vikram Garhwal <[email protected]> +M: Vikram Garhwal <[email protected]> S: Maintained W: https://canbus.pages.fel.cvut.cz/ F: net/can/*
Signature · 1 line
2.43.0
[PULL 02/20] target/arm/whpx: incorrect ENCODE_AA64_CP_REG parameter order
In reply to Peter MaydellFrom: Doug Cook <[email protected]>
ENCODE_AA64_CP_REG expects parameters (op0, op1, crn, crm, op2) but whpx was using parameter order (crn, crm, op0, op1, op2). As a result, every call to get_arm_cp_reginfo() returned NULL, cp_idx was -1, and both whpx_get_registers() and whpx_set_registers() were no-ops.
In addition, several encodings were paired with the wrong WHV register tag. These are inert while the encodings do not resolve, but would sync the wrong register once they do:
- the series 1 debug register encodings used series 0 tags,
- the SP_EL0 encoding was tagged WHvArm64RegisterSpEl1, which would clobber SP_EL0 with SP_EL1 on get and never write SP_EL0 on set,
- the ID_AA64PFR0_EL1 encoding was tagged WHvArm64RegisterIdPfr0El1.
Fix parameter order (using a regular expression). Fix tags.
--- target/arm/whpx/whpx-all.c | 218 ++++++++++++++++++------------------- 1 file changed, 109 insertions(+), 109 deletions(-)
target/arm/whpx/whpx-all.c +109 -109
@@ -135,145 +135,145 @@ struct whpx_sreg_match { };static struct whpx_sreg_match whpx_sreg_match[] = { - { WHvArm64RegisterDbgbvr0El1,ENCODE_AA64_CP_REG (0 ,0 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr0El1,ENCODE_AA64_CP_REG (0 ,0 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr0El1,ENCODE_AA64_CP_REG (0 ,0 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr0El1,ENCODE_AA64_CP_REG (0 ,0 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr0El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,0 ,4 ) }, + { WHvArm64RegisterDbgbcr0El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,0 ,5 ) }, + { WHvArm64RegisterDbgwvr0El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,0 ,6 ) }, + { WHvArm64RegisterDbgwcr0El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,0 ,7 ) }, - { WHvArm64RegisterDbgbvr0El1,ENCODE_AA64_CP_REG (0 ,1 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr0El1,ENCODE_AA64_CP_REG (0 ,1 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr0El1,ENCODE_AA64_CP_REG (0 ,1 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr0El1,ENCODE_AA64_CP_REG (0 ,1 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr1El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,1 ,4 ) }, + { WHvArm64RegisterDbgbcr1El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,1 ,5 ) }, + { WHvArm64RegisterDbgwvr1El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,1 ,6 ) }, + { WHvArm64RegisterDbgwcr1El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,1 ,7 ) }, - { WHvArm64RegisterDbgbvr2El1,ENCODE_AA64_CP_REG (0 ,2 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr2El1,ENCODE_AA64_CP_REG (0 ,2 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr2El1,ENCODE_AA64_CP_REG (0 ,2 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr2El1,ENCODE_AA64_CP_REG (0 ,2 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr2El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,2 ,4 ) }, + { WHvArm64RegisterDbgbcr2El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,2 ,5 ) }, + { WHvArm64RegisterDbgwvr2El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,2 ,6 ) }, + { WHvArm64RegisterDbgwcr2El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,2 ,7 ) }, - { WHvArm64RegisterDbgbvr3El1,ENCODE_AA64_CP_REG (0 ,3 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr3El1,ENCODE_AA64_CP_REG (0 ,3 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr3El1,ENCODE_AA64_CP_REG (0 ,3 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr3El1,ENCODE_AA64_CP_REG (0 ,3 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr3El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,3 ,4 ) }, + { WHvArm64RegisterDbgbcr3El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,3 ,5 ) }, + { WHvArm64RegisterDbgwvr3El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,3 ,6 ) }, + { WHvArm64RegisterDbgwcr3El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,3 ,7 ) }, - { WHvArm64RegisterDbgbvr4El1,ENCODE_AA64_CP_REG (0 ,4 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr4El1,ENCODE_AA64_CP_REG (0 ,4 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr4El1,ENCODE_AA64_CP_REG (0 ,4 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr4El1,ENCODE_AA64_CP_REG (0 ,4 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr4El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,4 ,4 ) }, + { WHvArm64RegisterDbgbcr4El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,4 ,5 ) }, + { WHvArm64RegisterDbgwvr4El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,4 ,6 ) }, + { WHvArm64RegisterDbgwcr4El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,4 ,7 ) }, - { WHvArm64RegisterDbgbvr5El1,ENCODE_AA64_CP_REG (0 ,5 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr5El1,ENCODE_AA64_CP_REG (0 ,5 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr5El1,ENCODE_AA64_CP_REG (0 ,5 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr5El1,ENCODE_AA64_CP_REG (0 ,5 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr5El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,5 ,4 ) }, + { WHvArm64RegisterDbgbcr5El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,5 ,5 ) }, + { WHvArm64RegisterDbgwvr5El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,5 ,6 ) }, + { WHvArm64RegisterDbgwcr5El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,5 ,7 ) }, - { WHvArm64RegisterDbgbvr6El1,ENCODE_AA64_CP_REG (0 ,6 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr6El1,ENCODE_AA64_CP_REG (0 ,6 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr6El1,ENCODE_AA64_CP_REG (0 ,6 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr6El1,ENCODE_AA64_CP_REG (0 ,6 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr6El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,6 ,4 ) }, + { WHvArm64RegisterDbgbcr6El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,6 ,5 ) }, + { WHvArm64RegisterDbgwvr6El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,6 ,6 ) }, + { WHvArm64RegisterDbgwcr6El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,6 ,7 ) }, - { WHvArm64RegisterDbgbvr7El1,ENCODE_AA64_CP_REG (0 ,7 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr7El1,ENCODE_AA64_CP_REG (0 ,7 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr7El1,ENCODE_AA64_CP_REG (0 ,7 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr7El1,ENCODE_AA64_CP_REG (0 ,7 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr7El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,7 ,4 ) }, + { WHvArm64RegisterDbgbcr7El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,7 ,5 ) }, + { WHvArm64RegisterDbgwvr7El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,7 ,6 ) }, + { WHvArm64RegisterDbgwcr7El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,7 ,7 ) }, - { WHvArm64RegisterDbgbvr8El1,ENCODE_AA64_CP_REG (0 ,8 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr8El1,ENCODE_AA64_CP_REG (0 ,8 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr8El1,ENCODE_AA64_CP_REG (0 ,8 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr8El1,ENCODE_AA64_CP_REG (0 ,8 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr8El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,8 ,4 ) }, + { WHvArm64RegisterDbgbcr8El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,8 ,5 ) }, + { WHvArm64RegisterDbgwvr8El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,8 ,6 ) }, + { WHvArm64RegisterDbgwcr8El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,8 ,7 ) }, - { WHvArm64RegisterDbgbvr9El1,ENCODE_AA64_CP_REG (0 ,9 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr9El1,ENCODE_AA64_CP_REG (0 ,9 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr9El1,ENCODE_AA64_CP_REG (0 ,9 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr9El1,ENCODE_AA64_CP_REG (0 ,9 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr9El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,9 ,4 ) }, + { WHvArm64RegisterDbgbcr9El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,9 ,5 ) }, + { WHvArm64RegisterDbgwvr9El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,9 ,6 ) }, + { WHvArm64RegisterDbgwcr9El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,9 ,7 ) }, - { WHvArm64RegisterDbgbvr10El1,ENCODE_AA64_CP_REG (0 ,10 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr10El1,ENCODE_AA64_CP_REG (0 ,10 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr10El1,ENCODE_AA64_CP_REG (0 ,10 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr10El1,ENCODE_AA64_CP_REG (0 ,10 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr10El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,10 ,4 ) }, + { WHvArm64RegisterDbgbcr10El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,10 ,5 ) }, + { WHvArm64RegisterDbgwvr10El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,10 ,6 ) }, + { WHvArm64RegisterDbgwcr10El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,10 ,7 ) }, - { WHvArm64RegisterDbgbvr11El1,ENCODE_AA64_CP_REG (0 ,11 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr11El1,ENCODE_AA64_CP_REG (0 ,11 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr11El1,ENCODE_AA64_CP_REG (0 ,11 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr11El1,ENCODE_AA64_CP_REG (0 ,11 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr11El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,11 ,4 ) }, + { WHvArm64RegisterDbgbcr11El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,11 ,5 ) }, + { WHvArm64RegisterDbgwvr11El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,11 ,6 ) }, + { WHvArm64RegisterDbgwcr11El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,11 ,7 ) }, - { WHvArm64RegisterDbgbvr12El1,ENCODE_AA64_CP_REG (0 ,12 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr12El1,ENCODE_AA64_CP_REG (0 ,12 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr12El1,ENCODE_AA64_CP_REG (0 ,12 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr12El1,ENCODE_AA64_CP_REG (0 ,12 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr12El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,12 ,4 ) }, + { WHvArm64RegisterDbgbcr12El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,12 ,5 ) }, + { WHvArm64RegisterDbgwvr12El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,12 ,6 ) }, + { WHvArm64RegisterDbgwcr12El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,12 ,7 ) }, - { WHvArm64RegisterDbgbvr13El1,ENCODE_AA64_CP_REG (0 ,13 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr13El1,ENCODE_AA64_CP_REG (0 ,13 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr13El1,ENCODE_AA64_CP_REG (0 ,13 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr13El1,ENCODE_AA64_CP_REG (0 ,13 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr13El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,13 ,4 ) }, + { WHvArm64RegisterDbgbcr13El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,13 ,5 ) }, + { WHvArm64RegisterDbgwvr13El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,13 ,6 ) }, + { WHvArm64RegisterDbgwcr13El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,13 ,7 ) }, - { WHvArm64RegisterDbgbvr14El1,ENCODE_AA64_CP_REG (0 ,14 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr14El1,ENCODE_AA64_CP_REG (0 ,14 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr14El1,ENCODE_AA64_CP_REG (0 ,14 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr14El1,ENCODE_AA64_CP_REG (0 ,14 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr14El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,14 ,4 ) }, + { WHvArm64RegisterDbgbcr14El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,14 ,5 ) }, + { WHvArm64RegisterDbgwvr14El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,14 ,6 ) }, + { WHvArm64RegisterDbgwcr14El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,14 ,7 ) }, - { WHvArm64RegisterDbgbvr15El1,ENCODE_AA64_CP_REG (0 ,15 ,2 ,0 ,4 ) }, - { WHvArm64RegisterDbgbcr15El1,ENCODE_AA64_CP_REG (0 ,15 ,2 ,0 ,5 ) }, - { WHvArm64RegisterDbgwvr15El1,ENCODE_AA64_CP_REG (0 ,15 ,2 ,0 ,6 ) }, - { WHvArm64RegisterDbgwcr15El1,ENCODE_AA64_CP_REG (0 ,15 ,2 ,0 ,7 ) }, + { WHvArm64RegisterDbgbvr15El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,15 ,4 ) }, + { WHvArm64RegisterDbgbcr15El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,15 ,5 ) }, + { WHvArm64RegisterDbgwvr15El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,15 ,6 ) }, + { WHvArm64RegisterDbgwcr15El1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,15 ,7 ) }, #ifdef SYNC_NO_RAW_REGS/* * The registers below are manually synced on init because they are * marked as NO_RAW. We still list them to make number space sync easier. */ - { WHvArm64RegisterMidrEl1,ENCODE_AA64_CP_REG (0 ,0 ,3 ,0 ,0 ) }, - { WHvArm64RegisterMpidrEl1,ENCODE_AA64_CP_REG (0 ,0 ,3 ,0 ,5 ) }, - { WHvArm64RegisterIdPfr0El1,ENCODE_AA64_CP_REG (0 ,4 ,3 ,0 ,0 ) }, + { WHvArm64RegisterMidrEl1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,0 ,0 ) }, + { WHvArm64RegisterMpidrEl1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,0 ,5 ) }, + { WHvArm64RegisterIdAa64Pfr0El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,4 ,0 ) }, #endif #ifdef SYNC_CONST_ID_REGS/* ID registers are ARM_CP_CONST (writes ignored). */ - { WHvArm64RegisterIdAa64Pfr1El1,ENCODE_AA64_CP_REG (0 ,4 ,3 ,0 ,1 ), true }, - { WHvArm64RegisterIdAa64Dfr0El1,ENCODE_AA64_CP_REG (0 ,5 ,3 ,0 ,0 ), true }, - { WHvArm64RegisterIdAa64Dfr1El1,ENCODE_AA64_CP_REG (0 ,5 ,3 ,0 ,1 ), true }, - { WHvArm64RegisterIdAa64Isar0El1,ENCODE_AA64_CP_REG (0 ,6 ,3 ,0 ,0 ), true }, - { WHvArm64RegisterIdAa64Isar1El1,ENCODE_AA64_CP_REG (0 ,6 ,3 ,0 ,1 ), true }, + { WHvArm64RegisterIdAa64Pfr1El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,4 ,1 ), true }, + { WHvArm64RegisterIdAa64Dfr0El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,5 ,0 ), true }, + { WHvArm64RegisterIdAa64Dfr1El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,5 ,1 ), true }, + { WHvArm64RegisterIdAa64Isar0El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,6 ,0 ), true }, + { WHvArm64RegisterIdAa64Isar1El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,6 ,1 ), true }, #ifdef SYNC_NO_MMFR0/* We keep the hardware MMFR0 around. HW limits are there anyway */ - { WHvArm64RegisterIdAa64Mmfr0El1,ENCODE_AA64_CP_REG (0 ,7 ,3 ,0 ,0 ) }, + { WHvArm64RegisterIdAa64Mmfr0El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,7 ,0 ) }, #endif - { WHvArm64RegisterIdAa64Mmfr1El1,ENCODE_AA64_CP_REG (0 ,7 ,3 ,0 ,1 ), true }, - { WHvArm64RegisterIdAa64Mmfr2El1,ENCODE_AA64_CP_REG (0 ,7 ,3 ,0 ,2 ), true }, - { WHvArm64RegisterIdAa64Mmfr3El1,ENCODE_AA64_CP_REG (0 ,7 ,3 ,0 ,3 ), true }, + { WHvArm64RegisterIdAa64Mmfr1El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,7 ,1 ), true }, + { WHvArm64RegisterIdAa64Mmfr2El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,7 ,2 ), true }, + { WHvArm64RegisterIdAa64Mmfr3El1,ENCODE_AA64_CP_REG (3 ,0 ,0 ,7 ,3 ), true }, #endif - { WHvArm64RegisterMdscrEl1,ENCODE_AA64_CP_REG (0 ,2 ,2 ,0 ,2 ) }, - { WHvArm64RegisterSctlrEl1,ENCODE_AA64_CP_REG (1 ,0 ,3 ,0 ,0 ) }, - { WHvArm64RegisterCpacrEl1,ENCODE_AA64_CP_REG (1 ,0 ,3 ,0 ,2 ) }, - { WHvArm64RegisterTtbr0El1,ENCODE_AA64_CP_REG (2 ,0 ,3 ,0 ,0 ) }, - { WHvArm64RegisterTtbr1El1,ENCODE_AA64_CP_REG (2 ,0 ,3 ,0 ,1 ) }, - { WHvArm64RegisterTcrEl1,ENCODE_AA64_CP_REG (2 ,0 ,3 ,0 ,2 ) }, + { WHvArm64RegisterMdscrEl1,ENCODE_AA64_CP_REG (2 ,0 ,0 ,2 ,2 ) }, + { WHvArm64RegisterSctlrEl1,ENCODE_AA64_CP_REG (3 ,0 ,1 ,0 ,0 ) }, + { WHvArm64RegisterCpacrEl1,ENCODE_AA64_CP_REG (3 ,0 ,1 ,0 ,2 ) }, + { WHvArm64RegisterTtbr0El1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,0 ,0 ) }, + { WHvArm64RegisterTtbr1El1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,0 ,1 ) }, + { WHvArm64RegisterTcrEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,0 ,2 ) }, - { WHvArm64RegisterApiAKeyLoEl1,ENCODE_AA64_CP_REG (2 ,1 ,3 ,0 ,0 ) }, - { WHvArm64RegisterApiAKeyHiEl1,ENCODE_AA64_CP_REG (2 ,1 ,3 ,0 ,1 ) }, - { WHvArm64RegisterApiBKeyLoEl1,ENCODE_AA64_CP_REG (2 ,1 ,3 ,0 ,2 ) }, - { WHvArm64RegisterApiBKeyHiEl1,ENCODE_AA64_CP_REG (2 ,1 ,3 ,0 ,3 ) }, - { WHvArm64RegisterApdAKeyLoEl1,ENCODE_AA64_CP_REG (2 ,2 ,3 ,0 ,0 ) }, - { WHvArm64RegisterApdAKeyHiEl1,ENCODE_AA64_CP_REG (2 ,2 ,3 ,0 ,1 ) }, - { WHvArm64RegisterApdBKeyLoEl1,ENCODE_AA64_CP_REG (2 ,2 ,3 ,0 ,2 ) }, - { WHvArm64RegisterApdBKeyHiEl1,ENCODE_AA64_CP_REG (2 ,2 ,3 ,0 ,3 ) }, - { WHvArm64RegisterApgAKeyLoEl1,ENCODE_AA64_CP_REG (2 ,3 ,3 ,0 ,0 ) }, - { WHvArm64RegisterApgAKeyHiEl1,ENCODE_AA64_CP_REG (2 ,3 ,3 ,0 ,1 ) }, + { WHvArm64RegisterApiAKeyLoEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,1 ,0 ) }, + { WHvArm64RegisterApiAKeyHiEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,1 ,1 ) }, + { WHvArm64RegisterApiBKeyLoEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,1 ,2 ) }, + { WHvArm64RegisterApiBKeyHiEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,1 ,3 ) }, + { WHvArm64RegisterApdAKeyLoEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,2 ,0 ) }, + { WHvArm64RegisterApdAKeyHiEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,2 ,1 ) }, + { WHvArm64RegisterApdBKeyLoEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,2 ,2 ) }, + { WHvArm64RegisterApdBKeyHiEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,2 ,3 ) }, + { WHvArm64RegisterApgAKeyLoEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,3 ,0 ) }, + { WHvArm64RegisterApgAKeyHiEl1,ENCODE_AA64_CP_REG (3 ,0 ,2 ,3 ,1 ) }, - { WHvArm64RegisterSpsrEl1,ENCODE_AA64_CP_REG (4 ,0 ,3 ,0 ,0 ) }, - { WHvArm64RegisterElrEl1,ENCODE_AA64_CP_REG (4 ,0 ,3 ,0 ,1 ) }, - { WHvArm64RegisterSpEl1,ENCODE_AA64_CP_REG (4 ,1 ,3 ,0 ,0 ) }, - { WHvArm64RegisterEsrEl1,ENCODE_AA64_CP_REG (5 ,2 ,3 ,0 ,0 ) }, - { WHvArm64RegisterFarEl1,ENCODE_AA64_CP_REG (6 ,0 ,3 ,0 ,0 ) }, - { WHvArm64RegisterParEl1,ENCODE_AA64_CP_REG (7 ,4 ,3 ,0 ,0 ) }, - { WHvArm64RegisterMairEl1,ENCODE_AA64_CP_REG (10 ,2 ,3 ,0 ,0 ) }, - { WHvArm64RegisterVbarEl1,ENCODE_AA64_CP_REG (12 ,0 ,3 ,0 ,0 ) }, - { WHvArm64RegisterContextidrEl1,ENCODE_AA64_CP_REG (13 ,0 ,3 ,0 ,1 ) }, - { WHvArm64RegisterTpidrEl1,ENCODE_AA64_CP_REG (13 ,0 ,3 ,0 ,4 ) }, - { WHvArm64RegisterCntkctlEl1,ENCODE_AA64_CP_REG (14 ,1 ,3 ,0 ,0 ) }, - { WHvArm64RegisterCsselrEl1,ENCODE_AA64_CP_REG (0 ,0 ,3 ,2 ,0 ) }, - { WHvArm64RegisterTpidrEl0,ENCODE_AA64_CP_REG (13 ,0 ,3 ,3 ,2 ) }, - { WHvArm64RegisterTpidrroEl0,ENCODE_AA64_CP_REG (13 ,0 ,3 ,3 ,3 ) }, - { WHvArm64RegisterCntvCtlEl0,ENCODE_AA64_CP_REG (14 ,3 ,3 ,3 ,1 ) }, - { WHvArm64RegisterCntvCvalEl0,ENCODE_AA64_CP_REG (14 ,3 ,3 ,3 ,2 ) }, - { WHvArm64RegisterSpEl1,ENCODE_AA64_CP_REG (4 ,1 ,3 ,4 ,0 ) }, + { WHvArm64RegisterSpsrEl1,ENCODE_AA64_CP_REG (3 ,0 ,4 ,0 ,0 ) }, + { WHvArm64RegisterElrEl1,ENCODE_AA64_CP_REG (3 ,0 ,4 ,0 ,1 ) }, + { WHvArm64RegisterSpEl0,ENCODE_AA64_CP_REG (3 ,0 ,4 ,1 ,0 ) }, + { WHvArm64RegisterEsrEl1,ENCODE_AA64_CP_REG (3 ,0 ,5 ,2 ,0 ) }, + { WHvArm64RegisterFarEl1,ENCODE_AA64_CP_REG (3 ,0 ,6 ,0 ,0 ) }, + { WHvArm64RegisterParEl1,ENCODE_AA64_CP_REG (3 ,0 ,7 ,4 ,0 ) }, + { WHvArm64RegisterMairEl1,ENCODE_AA64_CP_REG (3 ,0 ,10 ,2 ,0 ) }, + { WHvArm64RegisterVbarEl1,ENCODE_AA64_CP_REG (3 ,0 ,12 ,0 ,0 ) }, + { WHvArm64RegisterContextidrEl1,ENCODE_AA64_CP_REG (3 ,0 ,13 ,0 ,1 ) }, + { WHvArm64RegisterTpidrEl1,ENCODE_AA64_CP_REG (3 ,0 ,13 ,0 ,4 ) }, + { WHvArm64RegisterCntkctlEl1,ENCODE_AA64_CP_REG (3 ,0 ,14 ,1 ,0 ) }, + { WHvArm64RegisterCsselrEl1,ENCODE_AA64_CP_REG (3 ,2 ,0 ,0 ,0 ) }, + { WHvArm64RegisterTpidrEl0,ENCODE_AA64_CP_REG (3 ,3 ,13 ,0 ,2 ) }, + { WHvArm64RegisterTpidrroEl0,ENCODE_AA64_CP_REG (3 ,3 ,13 ,0 ,3 ) }, + { WHvArm64RegisterCntvCtlEl0,ENCODE_AA64_CP_REG (3 ,3 ,14 ,3 ,1 ) }, + { WHvArm64RegisterCntvCvalEl0,ENCODE_AA64_CP_REG (3 ,3 ,14 ,3 ,2 ) }, + { WHvArm64RegisterSpEl1,ENCODE_AA64_CP_REG (3 ,4 ,4 ,1 ,0 ) }, };HRESULT whpx_set_exception_exit_bitmap (UINT64 exceptions)
Signature · 1 line
2.43.0
[PULL 15/20] target/arm: initialize SCTLR reset value for arm11mpcore
In reply to Peter MaydellFrom: vpyr <[email protected]>
Initialize reset_sctlr to 0x00054078 in arm11mpcore_initfn.
Previously, the generic reset mechanism initialized SCTLR to zero because reset_sctlr was not set by the ARM11 MPCore CPU initialization function. The new value follows the fixed-bit requirements documented in ARM DDI 0360F, section 3.4.7, Table 3-20:
- Bits [21:16]: 000101, contributing 0x00050000
- Bit [14]: Should Be One / Read As One, contributing 0x00004000
- Bits [6:3]: Should Be One, contributing 0x00000078
V, U, and EE remain clear because their reset values depend on the VINITHI and CFGEND configuration signals.
After rebuilding, the test read SCTLR as 0x00054078 instead of zero, and the 0x00050078 mask check passed.
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4454
--- target/arm/tcg/cpu32.c | 1 + 1 file changed, 1 insertion(+)
target/arm/tcg/cpu32.c +1 -0
@@ -218,6 +218,7 @@ static void arm11mpcore_initfn(Object *obj) cpu->isar.mvfr0 =0x11111111 ; cpu->isar.mvfr1 =0x00000000 ; cpu->ctr =0x1d192992 ;/* 32K icache 32K dcache */ + cpu->reset_sctlr =0x00054078 ;SET_IDREG (isar,ID_PFR0 ,0x111 );SET_IDREG (isar,ID_PFR1 ,0x1 );SET_IDREG (isar,ID_DFR0 ,0 );
Signature · 1 line
2.43.0
[PULL 16/20] target/arm: enforce Armv6-M NVIC limits
In reply to Peter MaydellFrom: Gilles Grimaud <[email protected]>
Armv6-M supports no more than 32 external interrupts. Its ICTR and Active Bit Register locations are reserved, and Cortex-M0 implements two priority bits.
Reject Armv6-M NVIC configurations with more than 32 external interrupts. Add a check-tcg test that verifies the reserved register behavior and priority masking on the microbit machine.
--- hw/intc/armv7m_nvic.c | 5 ++ tests/tcg/arm/system/meson.build | 6 +++ tests/tcg/arm/system/test-armv6m-nvic.S | 70 +++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 tests/tcg/arm/system/test-armv6m-nvic.S
hw/intc/armv7m_nvic.c +5 -0
@@ -2728,6 +2728,11 @@ static void armv7m_nvic_realize(DeviceState *dev, Error **errp)return ; } +if (!arm_feature (&s->cpu->env,ARM_FEATURE_V7 ) && s->num_irq >32 ) { +error_setg (errp,"Armv6-M NVIC cannot exceed 32 external IRQs" ); +return ; + } +qdev_init_gpio_in (dev, set_irq_level, s->num_irq);/* include space for internal exception vectors */
tests/tcg/arm/system/meson.build +6 -0
@@ -39,6 +39,12 @@ tests += { '-T', files('test-armv6m-undef.ld')], 'qemu_args': ['-M', 'microbit', qemu_base_args], }, + 'test-armv6m-nvic.S': { + 'cflags': ['-mcpu=cortex-m0', '-mfloat-abi=soft', '-nostdlib', + '-Wl,--build-id=none', + '-T', files('test-armv6m-undef.ld')], + 'qemu_args': ['-M', 'microbit', qemu_base_args], + }, 'semiconsole.c': { 'cflags': cflags, 'qemu_args': ['-serial', 'none', '-chardev', 'stdio,mux=on,id=stdio0',
tests/tcg/arm/system/test-armv6m-nvic.S new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.43.0
Richard Henderson
AppliedQuoted 17 lines · Peter Maydell
Hi; here's an arm pullreq; pretty much all bugfixes this time.
thanks
-- PMMThe following changes since commit
5f664cd37aec17e8145aa117d8da68f507edc8f1:Merge tag 'ui-pr-v1' ofhttps://gitlab.com/marcandre.lureau/qemu into staging (2026-09-13 15:54:17 -1000)are available in the Git repository at:
https://gitlab.com/pm215/qemu.git tags/pull-target-arm-20260915for you to fetch changes up to
157f6c69edd0627f5f78f1f14ea0d831b0948c69:target/arm: extend PMSAv7 support to v6-M CPUs (2026-09-15 14:27:23 +0100)
Quoted 13 lines
----------------------------------------------------------------
target-arm queue:
* target/arm/whpx: fix whpx-arm post-reset CPU state
* target/arm/whpx: incorrectENCODE_AA64_CP_REGparameter order
* target/arm/whpx: Don't try to syncARM_CP_CONSTregisters
* hw/intc/bcm2835_ic: reject out-of-range FIQ source values
* sbsa-gwdt: reschedule timer on direct WCV load
* target/arm/hvf: implementMDCCSR_EL0as RAZ
* hw/char/stm32l4x5_usart: Accept character input upon RDR read
*MAINTAINERS: Update email address for Vikram Garhwal
* hw/misc/bcm2835_powermgt: free wdog timer on finalize
* target/arm: initialize SCTLR reset value for arm11mpcore
* target/arm: Fix various v6M corner-case bugs
Applied, thanks.
r~