x86/vmx: Correct the declaration of vmx_asm_vmexit_handler()
PATCH 1/1 x86/vmx: Correct the declaration of vmx_asm_vmexit_handler()
Taking struct cpu_user_regs as a full object is bogus, and while what was probably meant was to take a struct cpu_user_regs pointer, that's still wrong.
This isn't a function; its an address stored in the VMCS that the CPU resumes from on VMExit, meaning that it doesn't conform to a normal C API/ABI.
Annotate it with nocall, and move the declaration into vmcs.c next to its sole user.
`-> "Initial Intel VMX support"
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: Xenia Ragiadakou <[email protected]>
CC: Jun Nakajima <[email protected]>
CC: Kevin Tian <[email protected]>
--- xen/arch/x86/hvm/vmx/vmcs.c | 2 ++ xen/arch/x86/include/asm/hvm/vmx/vmx.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/hvm/vmx/vmcs.c +2 -0
@@ -1074,6 +1074,8 @@ static void pi_desc_init(struct vcpu *v) v->arch.hvm.vmx.pi_desc.ndst =APIC_INVALID_DEST ; } +void nocall vmx_asm_vmexit_handler(void); +static int construct_vmcs (struct vcpu *v) {struct domain *d = v->domain;
xen/arch/x86/include/asm/hvm/vmx/vmx.h +0 -1
@@ -82,7 +82,6 @@ typedef enum {#define PI_xAPIC_NDST_MASK 0xFF00 -void vmx_asm_vmexit_handler (struct cpu_user_regs );void vmx_intr_assist (void ); void noreturn cf_check vmx_do_resume(void); void cf_check vmx_vlapic_msr_changed(struct vcpu *v);
Signature · 1 line
2.30.2
Quoted 6 lines · Andrew Cooper
Taking struct
cpu_user_regsas a full object is bogus, and while what was probably meant was to take a structcpu_user_regspointer, that's still wrong.This isn't a function; its an address stored in the VMCS that the CPU resumes from on VMExit, meaning that it doesn't conform to a normal C API/ABI.
Quoted 7 lines
Annotate it with
nocall, and move the declaration intovmcs.cnext to its sole user.Fixes 9c3118a82523 ("bitkeeper revision 1.1159.1.483 (41c0c417XYObowWqbfqU0cdLx30C9w)")`-> "Initial Intel VMX support"Reported-by Jan Beulich <[email protected]>Signed-off-by Andrew Cooper <[email protected]>
Since I had to look up what exactly "nocall" expands to, I'm wondering whether it really is still the case that Clang doesn't support the error attribute ...
Jan
Quoted 15 lines · Jan Beulich
Quoted 6 lines · Andrew Cooper
Taking struct
cpu_user_regsas a full object is bogus, and while what was probably meant was to take a structcpu_user_regspointer, that's still wrong.This isn't a function; its an address stored in the VMCS that the CPU resumes from on VMExit, meaning that it doesn't conform to a normal C API/ABI.
Quoted 7 lines
Annotate it with
nocall, and move the declaration intovmcs.cnext to its sole user.Fixes 9c3118a82523 ("bitkeeper revision 1.1159.1.483 (41c0c417XYObowWqbfqU0cdLx30C9w)")`-> "Initial Intel VMX support"Reported-by Jan Beulich <[email protected]>Signed-off-by Andrew Cooper <[email protected]>
Quoted 5 lines
Reviewed-by Jan Beulich <[email protected]>Since I had to look up what exactly "nocall" expands to, I'm wondering whether it really is still the case that Clang doesn't support the error attribute ...
Argh, should have looked at your next patch ...
Jan