[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] vvmx: replace vmreturn() by vmsucceed() and vmfail*()
On 15/12/16 12:32, Haozhong Zhang wrote: > On 12/15/16 12:18 +0000, Andrew Cooper wrote: >> On 15/12/16 12:06, Haozhong Zhang wrote: >>> Replace vmreturn() by vmsucceed(), vmfail(), vmfail_valid() and >>> vmfail_invalid(), which are consistent to the pseudo code on Intel >>> SDM, and allow to return VM instruction error numbers to L1 >>> hypervisor. >>> >>> Signed-off-by: Haozhong Zhang <haozhong.zhang@xxxxxxxxx> >>> --- >>> Changes in v2: >>> * Fix the incorrect eflags in vmfail_invalid(). >>> --- >>> xen/arch/x86/hvm/vmx/vvmx.c | 107 >>> +++++++++++++++++++++---------------- >>> xen/include/asm-x86/hvm/vmx/vmcs.h | 15 ++++-- >>> 2 files changed, 74 insertions(+), 48 deletions(-) >>> >>> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c >>> index c4f19a0..361620d 100644 >>> --- a/xen/arch/x86/hvm/vmx/vvmx.c >>> +++ b/xen/arch/x86/hvm/vmx/vvmx.c >>> @@ -479,28 +479,37 @@ gp_fault: >>> return X86EMUL_EXCEPTION; >>> } >>> >>> -static void vmreturn(struct cpu_user_regs *regs, enum >>> vmx_ops_result ops_res) >>> +#define VMSUCCEED_EFLAGS_MASK \ >>> + (X86_EFLAGS_CF | X86_EFLAGS_PF | X86_EFLAGS_AF | \ >>> + X86_EFLAGS_ZF | X86_EFLAGS_SF | X86_EFLAGS_OF) >> >> Apologies to nitpick, but this these aren't vmx specific, and we have >> had a similar patten in the x86 instruction emulator. >> >> Would you mind incorporating: >> >> andrewcoop@andrewcoop:/local/xen.git/xen$ git diff >> diff --git a/xen/include/asm-x86/processor.h >> b/xen/include/asm-x86/processor.h >> index eae4af2..01fc446 100644 >> --- a/xen/include/asm-x86/processor.h >> +++ b/xen/include/asm-x86/processor.h >> @@ -53,6 +53,10 @@ >> #define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */ >> #define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ >> >> +#define X86_EFLAGS_ARITH_MASK \ >> + ((X86_EFLAGS_CF | X86_EFLAGS_PF | X86_EFLAGS_AF | \ >> + X86_EFLAGS_ZF | X86_EFLAGS_SF | X86_EFLAGS_OF)) >> + > > Sure. And any reason to use double parentheses? No, sorry. Just being a bit too quick when typing. Please drop. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |