KVM: SVM: Fix __svm_vcpu_run declaration.
PATCH 1/1 KVM: SVM: Fix __svm_vcpu_run declaration.
The function returns no value.
--- arch/x86/kvm/svm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/svm/svm.c +1 -1
@@ -3276,7 +3276,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)svm_complete_interrupts (svm); } -bool __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs); +void __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs);static void svm_vcpu_run (struct kvm_vcpu *vcpu) {
Signature · 1 line
2.25.2
Hi Bizjak,
Quoted 14 lines · Uros Bizjak
The function returns no value.
Cc Paolo Bonzini <[email protected]>Fixes 199cd1d7b534 ("KVM: SVM: Split svm_vcpu_run inline assembly to separate file")Signed-off-by Uros Bizjak <[email protected]>--- arch/x86/kvm/svm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/svm/svm.c +0
-0
arch/x86/kvm/svm/svm.c static void svm_cancel_injection(struct kvm_vcpu *vcpu) · line 3279
Quoted 4 lines
arch/x86/kvm/svm/svm.c +0
-1@@ -3276,7 +3276,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)svm_complete_interrupts (svm); } -bool __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs);
Just curious if __svm_vcpu_run() will fail to enter SVM guest mode,
and a return value could indicate that nothing went wrong rather than blindly keeping silent.
Thanks,
Like Xu
Quoted 4 lines
arch/x86/kvm/svm/svm.c +1
-0+void __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs);static void svm_vcpu_run (struct kvm_vcpu *vcpu) {
Paolo Bonzini
maintainerQuoted 5 lines · Like
Quoted 2 lines
-bool
__svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);Just curious if
__svm_vcpu_run()will fail to enter SVM guest mode, and a return value could indicate that nothing went wrong rather than blindly keeping silent.
That's already available in the exit code (which is 0xffffffff when vmentry fails).
Paolo
Hi Paolo,
Quoted 7 lines · Paolo Bonzini
Quoted 4 lines · Like
Quoted 1 line
-bool
__svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);Just curious if
__svm_vcpu_run()will fail to enter SVM guest mode, and a return value could indicate that nothing went wrong rather than blindly keeping silent.That's already available in the exit code (which is
0xffffffffwhen vmentry fails).
Yes, I assume the svm->vmcb->control.exit_code is referred.
What makes me confused is
why we need "vmx->exit_reason" and "vmx->fail"
for the same general purpose, but svm does not.
Thanks,
Like Xu
Quoted 3 lines
Paolo
Paolo Bonzini
maintainerQuoted 6 lines · Like
Quoted 1 line
Yes, I assume the
svm->vmcb->control.exit_codeis referred.What makes me confused is
why we need "vmx->exit_reason" and "vmx->fail"
for the same general purpose, but svm does not.
Because VMLAUNCH/VMRESUME can also report vmFailValid and vmFailInvalid via the carry and zero flags, there is no equivalent of that for AMD virtualization extensions.
Paolo
Quoted 9 lines · Paolo Bonzini
Quoted 5 lines · Like
Yes, I assume the
svm->vmcb->control.exit_codeis referred.What makes me confused is
why we need "vmx->exit_reason" and "vmx->fail"
for the same general purpose, but svm does not.Because VMLAUNCH/VMRESUME can also report vmFailValid and vmFailInvalid via the carry and zero flags, there is no equivalent of that for AMD virtualization extensions.
Oh, this makes sense to me. Thanks!
Let me confirm it from both specifications.
Quoted 3 lines
Paolo
Quoted 21 lines · Like
Hi Bizjak,
Quoted 17 lines · Uros Bizjak
The function returns no value.
Cc Paolo Bonzini <[email protected]>Fixes 199cd1d7b534 ("KVM: SVM: Split svm_vcpu_run inline assembly to separate file")Signed-off-by Uros Bizjak <[email protected]>--- arch/x86/kvm/svm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/svm/svm.c +0
-0@@ -3276,7 +3276,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)svm_complete_interrupts (svm); }
Quoted 4 lines
arch/x86/kvm/svm/svm.c static void svm_cancel_injection(struct kvm_vcpu *vcpu) · line 3279
Quoted 1 line
arch/x86/kvm/svm/svm.c +0
-1-bool __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs);Just curious if
__svm_vcpu_run()will fail to enter SVM guest mode, and a return value could indicate that nothing went wrong rather than blindly keeping silent.
vmload, vmrun and vmsave do not return anything in flags or registers, so we can't detect anything at this point, modulo exception that is handled below the respective instruction.
BTW: the change by itself does not change the generated code, the fake return value from __svm_vcpu_run is already ignored. So, the change is mostly cosmetic.
Uros.
Quoted 21 lines · Uros Bizjak
Quoted 20 lines · Like
Hi Bizjak,
Quoted 17 lines · Uros Bizjak
The function returns no value.
Cc Paolo Bonzini <[email protected]>Fixes 199cd1d7b534 ("KVM: SVM: Split svm_vcpu_run inline assembly to separate file")Signed-off-by Uros Bizjak <[email protected]>--- arch/x86/kvm/svm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/svm/svm.c +0
-0@@ -3276,7 +3276,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)svm_complete_interrupts (svm); }
Quoted 7 lines
Quoted 4 lines
arch/x86/kvm/svm/svm.c static void svm_cancel_injection(struct kvm_vcpu *vcpu) · line 3279
Quoted 1 line
arch/x86/kvm/svm/svm.c +0
-1-bool __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs);Just curious if
__svm_vcpu_run()will fail to enter SVM guest mode, and a return value could indicate that nothing went wrong rather than blindly keeping silent.vmload, vmrun and vmsave do not return anything in flags or registers, so we can't detect anything at this point, modulo exception that is handled below the respective instruction.
If we check the __vmx_vcpu_run(), we have something like:
/* VM-Fail. Out-of-line to avoid a taken Jcc after VM-Exit. */ 2: mov $1, %eax
jmp 1b
so do we need it in the __svm_vcpu_run() or why not ?
Quoted 4 lines
BTW: the change by itself does not change the generated code, the fake return value from
__svm_vcpu_runis already ignored. So, the change is mostly cosmetic.
Yes, the generated code is not affected and the change is reasonable.
Quoted 2 lines
Uros.
Quoted 15 lines · Uros Bizjak
The function returns no value.
Cc Paolo Bonzini <[email protected]>Fixes 199cd1d7b534 ("KVM: SVM: Split svm_vcpu_run inline assembly to separate file")Signed-off-by Uros Bizjak <[email protected]>--- arch/x86/kvm/svm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/svm/svm.c +0
-0
arch/x86/kvm/svm/svm.c static void svm_cancel_injection(struct kvm_vcpu *vcpu) · line 3282
Quoted 8 lines
arch/x86/kvm/svm/svm.c +1
-1@@ -3276,7 +3276,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)svm_complete_interrupts (svm); } -bool __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs); +void __svm_vcpu_run (unsigned long vmcb_pa,unsigned long *regs);static void svm_vcpu_run (struct kvm_vcpu *vcpu) {
Queued, thanks.
Paolo