@@ -4417,42 +4417,6 @@ static CPAccessResult access_el1nvvct(CPUARMState *env, const ARMCPRegInfo *ri,
44174417 return e2h_access (env , ri , isread );
44184418}
44194419
4420- static uint64_t el2_e2h_e12_read (CPUARMState * env , const ARMCPRegInfo * ri )
4421- {
4422- /* Pass the EL1 register accessor its ri, not the EL12 alias ri */
4423- return ri -> orig_readfn (env , ri -> opaque );
4424- }
4425-
4426- static void el2_e2h_e12_write (CPUARMState * env , const ARMCPRegInfo * ri ,
4427- uint64_t value )
4428- {
4429- /* Pass the EL1 register accessor its ri, not the EL12 alias ri */
4430- return ri -> orig_writefn (env , ri -> opaque , value );
4431- }
4432-
4433- static CPAccessResult el2_e2h_e12_access (CPUARMState * env ,
4434- const ARMCPRegInfo * ri ,
4435- bool isread )
4436- {
4437- if (arm_current_el (env ) == 1 ) {
4438- /*
4439- * This must be a FEAT_NV access (will either trap or redirect
4440- * to memory). None of the registers with _EL12 aliases want to
4441- * apply their trap controls for this kind of access, so don't
4442- * call the orig_accessfn or do the "UNDEF when E2H is 0" check.
4443- */
4444- return CP_ACCESS_OK ;
4445- }
4446- /* FOO_EL12 aliases only exist when E2H is 1; otherwise they UNDEF */
4447- if (!(arm_hcr_el2_eff (env ) & HCR_E2H )) {
4448- return CP_ACCESS_UNDEFINED ;
4449- }
4450- if (ri -> orig_accessfn ) {
4451- return ri -> orig_accessfn (env , ri -> opaque , isread );
4452- }
4453- return CP_ACCESS_OK ;
4454- }
4455-
44564420static void define_arm_vh_e2h_redirects_aliases (ARMCPU * cpu )
44574421{
44584422 struct E2HAlias {
@@ -4541,9 +4505,6 @@ static void define_arm_vh_e2h_redirects_aliases(ARMCPU *cpu)
45414505 g_assert (strcmp (src_reg -> name , a -> src_name ) == 0 );
45424506 g_assert (strcmp (dst_reg -> name , a -> dst_name ) == 0 );
45434507
4544- /* None of the core system registers use opaque; we will. */
4545- g_assert (src_reg -> opaque == NULL );
4546-
45474508 /* Create alias before redirection so we dup the right data. */
45484509 new_reg = g_memdup (src_reg , sizeof (ARMCPRegInfo ));
45494510
@@ -4562,19 +4523,11 @@ static void define_arm_vh_e2h_redirects_aliases(ARMCPU *cpu)
45624523 >> CP_REG_ARM64_SYSREG_OP1_SHIFT ;
45634524 new_reg -> opc2 = (a -> new_key & CP_REG_ARM64_SYSREG_OP2_MASK )
45644525 >> CP_REG_ARM64_SYSREG_OP2_SHIFT ;
4565- new_reg -> opaque = src_reg ;
4566- new_reg -> orig_readfn = src_reg -> readfn ?: raw_read ;
4567- new_reg -> orig_writefn = src_reg -> writefn ?: raw_write ;
4568- new_reg -> orig_accessfn = src_reg -> accessfn ;
4569- if (!new_reg -> raw_readfn ) {
4570- new_reg -> raw_readfn = raw_read ;
4571- }
4572- if (!new_reg -> raw_writefn ) {
4573- new_reg -> raw_writefn = raw_write ;
4574- }
4575- new_reg -> readfn = el2_e2h_e12_read ;
4576- new_reg -> writefn = el2_e2h_e12_write ;
4577- new_reg -> accessfn = el2_e2h_e12_access ;
4526+ new_reg -> vhe_redir_to_el01 = a -> src_key ;
4527+ new_reg -> readfn = NULL ;
4528+ new_reg -> writefn = NULL ;
4529+ new_reg -> accessfn = NULL ;
4530+ new_reg -> fieldoffset = 0 ;
45784531
45794532 /*
45804533 * If the _EL1 register is redirected to memory by FEAT_NV2,
0 commit comments