[PATCH 08/11] KVM: arm64: Inject AArch32 exceptions from HYP

Marc Zyngier maz at kernel.org
Wed Oct 28 16:24:37 EDT 2020


On 2020-10-28 19:20, James Morse wrote:
> Hi Marc,
> 
> On 27/10/2020 19:21, Marc Zyngier wrote:
>>>> +static inline u32 __vcpu_read_cp15(const struct kvm_vcpu *vcpu, int 
>>>> reg)
>>>> +{
>>>> +    return __vcpu_read_sys_reg(vcpu, reg / 2);
>>>> +}
> 
>>> Doesn't this re-implement the issue 3204be4109ad biased?
> 
>> I don't think it does. The issue existed when accessing the 32bit 
>> shadow,
>> and we had to pick which side of the 64bit register had our 32bit 
>> value.
>> Here, we directly access the 64bit file, which is safe.
> 
> Because its not accessing the copro union, and the two users are both
> straight forward aliases.
> 
> ...
> 
> What do I get if I call:
> | __vcpu_read_cp15(vcpu, c6_IFAR);
> 
> Won't this return the value of c6_DFAR instead as they live in the
> same 64 bit register.

Yes, that would break. Not in this bit of code though.

> 
> 
>> But thinking of it, we may as well change the call sites to directly
>> use the 64bit enum, rather than playing games
> 
> Great!

Yeah, and there is a bunch of ... crap around this aliasing.
Unfortunately, I just noticed that 32bit guests are borked in -rc1.
Debug time.

         M.
-- 
Jazz is not dead. It just smells funny...



More information about the linux-arm-kernel mailing list