Commit b9904085 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini
Browse files

KVM: Pass kvm_init()'s opaque param to additional arch funcs



Pass @opaque to kvm_arch_hardware_setup() and
kvm_arch_check_processor_compat() to allow architecture specific code to
reference @opaque without having to stash it away in a temporary global
variable.  This will enable x86 to separate its vendor specific callback
ops, which are passed via @opaque, into "init" and "runtime" ops without
having to stash away the "init" ops.

No functional change intended.

Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Tested-by: Cornelia Huck <cohuck@redhat.com> #s390
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200321202603.19355-2-sean.j.christopherson@intel.com>
Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 4f4af841
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -118,12 +118,12 @@ void kvm_arch_hardware_disable(void)
	kvm_mips_callbacks->hardware_disable();
}

int kvm_arch_hardware_setup(void)
int kvm_arch_hardware_setup(void *opaque)
{
	return 0;
}

int kvm_arch_check_processor_compat(void)
int kvm_arch_check_processor_compat(void *opaque)
{
	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -415,12 +415,12 @@ int kvm_arch_hardware_enable(void)
	return 0;
}

int kvm_arch_hardware_setup(void)
int kvm_arch_hardware_setup(void *opaque)
{
	return 0;
}

int kvm_arch_check_processor_compat(void)
int kvm_arch_check_processor_compat(void *opaque)
{
	return kvmppc_core_check_processor_compat();
}
+2 −2
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ int kvm_arch_hardware_enable(void)
	return 0;
}

int kvm_arch_check_processor_compat(void)
int kvm_arch_check_processor_compat(void *opaque)
{
	return 0;
}
@@ -302,7 +302,7 @@ static struct notifier_block kvm_clock_notifier = {
	.notifier_call = kvm_clock_sync,
};

int kvm_arch_hardware_setup(void)
int kvm_arch_hardware_setup(void *opaque)
{
	gmap_notifier.notifier_call = kvm_gmap_notifier;
	gmap_register_pte_notifier(&gmap_notifier);
+2 −2
Original line number Diff line number Diff line
@@ -9626,7 +9626,7 @@ void kvm_arch_hardware_disable(void)
	drop_user_return_notifiers();
}

int kvm_arch_hardware_setup(void)
int kvm_arch_hardware_setup(void *opaque)
{
	int r;

@@ -9667,7 +9667,7 @@ void kvm_arch_hardware_unsetup(void)
	kvm_x86_ops->hardware_unsetup();
}

int kvm_arch_check_processor_compat(void)
int kvm_arch_check_processor_compat(void *opaque)
{
	struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());

+2 −2
Original line number Diff line number Diff line
@@ -886,9 +886,9 @@ void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu);

int kvm_arch_hardware_enable(void);
void kvm_arch_hardware_disable(void);
int kvm_arch_hardware_setup(void);
int kvm_arch_hardware_setup(void *opaque);
void kvm_arch_hardware_unsetup(void);
int kvm_arch_check_processor_compat(void);
int kvm_arch_check_processor_compat(void *opaque);
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu);
int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
Loading