[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56E6AE3F.2030800@arm.com>
Date: Mon, 14 Mar 2016 12:27:43 +0000
From: "Suzuki K. Poulose" <Suzuki.Poulose@....com>
To: Marc Zyngier <marc.zyngier@....com>,
linux-arm-kernel@...ts.infradead.org
Cc: christoffer.dall@...aro.org, will.deacon@....com,
ynorov@...iumnetworks.com, catalin.marinas@....com,
mark.rutland@....com, linux-kernel@...r.kernel.org,
kvmarm@...ts.cs.columbia.edu
Subject: Re: [PATCH v2 8/8] arm64: kvm: Check support for AArch32 for 32bit
guests
On 02/03/16 09:08, Marc Zyngier wrote:
> On 25/02/16 09:52, Suzuki K Poulose wrote:
>> Add a check to make sure the system supports AArch32 state
>> before initialising a 32bit guest.
>>
>> Cc: Christoffer Dall <christoffer.dall@...aro.org>
>> Cc: Marc Zyngier <marc.zyngier@....com>
>> Cc: kvmarm@...ts.cs.columbia.edu
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
...
>> @@ -338,6 +340,12 @@ static inline void kvm_arch_sync_events(struct kvm *kvm) {}
>> static inline void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) {}
>> static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {}
>>
>> +static inline bool kvm_arch_vcpu_validate_features(struct kvm_vcpu_arch *arch_vcpu)
>> +{
>> + return !test_bit(KVM_ARM_VCPU_EL1_32BIT, arch_vcpu->features) ||
>> + system_supports_32bit_el0();
>> +}
>> +
>
> This is really convoluted (it took me 5 minutes staring at the
> expression and remembering that AArch32 EL1 implies AArch32 EL0 to get it).
>
> Now, we already have kvm_reset_vcpu() that validates AArch32 support. It
> would probably be better to move things there. Thoughts?
I think we can leave the kvm bits as it is now, discarding this patch, as
we already do the right thing. Also system_supports_32bit_el0() doesn't
guarantee system_supports_32bit_el1(). The negation and converse are
both true though.
i.e,
!32bit_el0_support => !32bit_el1_support
&
32bit_el1_support => 32bit_el0_support
Thanks
Suzuki
Powered by blists - more mailing lists