Subject: [PATCH v7 07/16] arm64: kvm: allows kvm cpu hotplug

From: [email-masked] (Marc Zyngier)
Date: Wed, 20 Apr 2016 11:37:11 +0100

On 19/04/16 18:37, James Morse wrote:
> Hi Marc, Takahiro,

[...]

> It looks like x86 uses the extable to work around this, their vmx_vcpu_run() has:
>> 		__ex(ASM_VMX_VMLAUNCH) "\n\t"
> Where __ex ends up calling ____kvm_handle_fault_on_reboot(), with a nearby comment:
>> * Hardware virtualization extension instructions may fault if a
>> * reboot turns off virtualization while processes are running.
>> * Trap the fault and ignore the instruction if that happens.

I very much like that approach, to be honest. Tearing down a CPU is
something exceptional, so let's make it an actual exception.

It is now pretty easy to discriminate between KVM functions and stub
functions thanks to your earlier patch, so if we end up calling the
hyp-stub because we've torn down KVM's EL2, let's just return an
appropriate error code (ARM_EXCEPTION_HYP_GONE), and handle it at EL1.

Thanks,

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