I have a multi-part question.

1. ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c(378):
      if (ArmReadCurrentEL () == AARCH64_EL2) {

This should also check E2H, right?

2. More broadly:
What about all other EL checks, primarily in EL1_OR_EL2 macro.
Mainly with mrs use, but also tlbi.

2a Leave them generally alone, let them trap, etc. and let hardware or 
hypervisor virtualize (i.e. if E2H; they are already correct in preexisting 
contexts).
2b Change the macro to also check E2H, leaving the name asis?
2c Make a new macro and gradually/rapidly convert many/all uses?
        EL1LIKE_OR_EL2? 
        EL1orE2H_OR_EL2? 
2d Other?

If decision is to have it check also E2H, people building physical-only (or 
E2H==0 only) might object to the code size growth? So have the definition of 
EL1_OR_EL2 itself guided by another ifdef?

e.g.
  #ifdef SUPPORT_E2H  
  #defi ne EL1_OR_EL2 ... new way   
  #else 
  #define EL1_OR_EL2 ... old way  
  #endif

 And then, there *might* be cases that need old way unconditionally? 
  #define EL1_OR_EL2_IGNORE_E2H ?  

Even if EL1_OR_EL2 is left alone to be trapped/emulated, maybe the multiple 
(2?) places in C that check EL==2 should share a "helper" function? 
ArmCurrentELBehavior() == 1 or 2?
ArmEL1OrE2H()?
Or even, redefine ArmReadCurrentEL to return AARCH64_EL1 for E2H?
Maybe changing ArmReadCurrentEL is too heavy handed and confusing.
You'll need some other function to read the "real" EL, ignoring E2H.

Anyway, surely there are many options, but the main question is to do something 
at all, or leave it mostly asis.

Thank you,
  - Jay

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#122017): https://edk2.groups.io/g/devel/message/122017
Mute This Topic: https://groups.io/mt/120041798/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to