[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/7] x86: extract macros to x86-defns.h



On Thu, Jan 26, 2017 at 03:55:27AM -0700, Jan Beulich wrote:
> >>> On 25.01.17 at 16:44, <wei.liu2@xxxxxxxxxx> wrote:
> > ... so that they can be used by userspace x86 instruction emulator test
> > program and fuzzer as well.
> 
> Ah, here we go. This should be patch 2 then imo.
> 
> > --- /dev/null
> > +++ b/xen/include/asm-x86/x86-defns.h
> > @@ -0,0 +1,125 @@
> > +#ifndef __XEN_X86_DEFNS_H__
> > +#define __XEN_X86_DEFNS_H__
> > +
> > +/*
> > + * CPU vendor IDs
> > + */
> > +#define X86_VENDOR_INTEL 0
> > +#define X86_VENDOR_AMD 1
> > +#define X86_VENDOR_CENTAUR 2
> > +#define X86_VENDOR_NUM 3
> > +#define X86_VENDOR_UNKNOWN 0xff
> 
> Let's strictly separate things: These aren't architectural definitions,
> so should - if we really mean to share them - go into another header.
> I'm not sure though whether sharing these is all that useful.

Actually I don't think these are needed.

I moved them because there were duplicates in x86emul/test. But after
having a closer look those duplicates are not used.

> 
> > +/* Set for entry via SYSCALL. Informs return code to use SYSRETQ not 
> > IRETQ. */
> > +/* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ 
> > defn. */
> > +#define TRAP_syscall         256
> > +
> > +/* Boolean return code: the reason for a fault has been fixed. */
> > +#define EXCRET_fault_fixed 1
> > +
> > +/* 'trap_bounce' flags values */
> > +#define TBF_EXCEPTION          1
> > +#define TBF_EXCEPTION_ERRCODE  2
> > +#define TBF_INTERRUPT          8
> > +
> > +/* 'arch_vcpu' flags values */
> > +#define _TF_kernel_mode        0
> > +#define TF_kernel_mode         (1<<_TF_kernel_mode)
> 
> None of these should be needed by the emulator, nor is any of this
> dictated by the architecture, so they all should remain in processor.h.
> 

OK.

Wei.

> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.