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

Re: [Xen-devel] [PATCH v5 18/28] xsplice: Add support for alternatives



On Fri, Apr 01, 2016 at 10:20:40AM -0600, Jan Beulich wrote:
> >>> On 24.03.16 at 21:00, <konrad.wilk@xxxxxxxxxx> wrote:
> > --- a/xen/arch/x86/alternative.c
> > +++ b/xen/arch/x86/alternative.c
> > @@ -28,7 +28,7 @@
> >  extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
> >  
> >  #ifdef K8_NOP1
> > -static const unsigned char k8nops[] __initconst = {
> > +static const unsigned char k8nops[] = {
> 
> Just like in Linux these init annotations should become conditional
> upon CONFIG_XSPLICE (and I realize this applies to at least the
> previous patch too).

I ended up declaring #define INIT __init and so on if CONFIG_XSPLICE
is not defined. Obviouslu they are empty if CONFIG_XSPLICE is set.

Since both alternative and exceptions use this I ended up putting
this in xsplice.h file.
..snip..
> >  /* Our replacement function for xen_extra_version. */
> >  const char *xen_hello_world(void)
> >  {
> > +    alternative(ASM_NOP1, ASM_NOP1, 1);
> 
> Above you say the code is being exercised by this: How can you be
> sure that whatever feature has value 1 is actually present? The
> pending SMEP/SMAP patches add X86_FEATURE_ALWAYS for such
> a purpose.

I must have missed them. I can change it once they go in. For right now
I just changed this X86_FEATURE_NX.

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

 


Rackspace

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