Thread (27 messages) 27 messages, 5 authors, 2021-11-19

Re: [PATCH v3 08/12] KVM: Propagate vcpu explicitly to mark_page_dirty_in_slot()

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2021-11-18 12:05:56
Also in: kvm, kvm-riscv, kvmarm, linux-arm-kernel, linux-s390, linuxppc-dev

On 11/17/21 22:09, David Woodhouse wrote:
quoted
  {
-	struct kvm_vcpu *vcpu = kvm_get_running_vcpu();
+	struct kvm_vcpu *running_vcpu = kvm_get_running_vcpu();

+	WARN_ON_ONCE(vcpu && vcpu != running_vcpu);
  	WARN_ON_ONCE(vcpu->kvm != kvm);
Ah, that one needs to be changed to check running_vcpu instead. Or this
needs to go first:

I think I prefer making the vCPU a required argument. If anyone's going to
pull a vCPU pointer out of their posterior, let the caller do it.
I understand that feeling, but still using the running vCPU is by far 
the common case, and it's not worth adding a new function parameter to 
all call sites.

What about using a separate function, possibly __-prefixed, for the case 
where you have a very specific vCPU?

Paolo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help