On Sat, Dec 05, 2015 at 07:19:18PM +0100, Mike Belopuhov wrote:
> This allocates a page-aligned page in the kernel text segment
> to be used by the hypercall interface.  The content of the page
> is provided by the Hypervisor itself when it's physical address
> is communicated via an MSR write (in the next diff).
> 
> OK?

If this is in kernel text, it will end up getting RX permissions.
Is that what you want? Does the hypervisor write actual code in
there or just data? 

If the latter, perhaps another location is better, maybe .rodata
or .data ?

-ml

> 
> ---
>  sys/arch/amd64/amd64/locore.S | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git sys/arch/amd64/amd64/locore.S sys/arch/amd64/amd64/locore.S
> index 618c6e7..f147131 100644
> --- sys/arch/amd64/amd64/locore.S
> +++ sys/arch/amd64/amd64/locore.S
> @@ -107,10 +107,11 @@
>  #include "assym.h"
>  #include "lapic.h"
>  #include "ioapic.h"
>  #include "ksyms.h"
>  #include "acpi.h"
> +#include "xen.h"
>  
>  #include <sys/errno.h>
>  #include <sys/syscall.h>
>  
>  #include <machine/param.h>
> @@ -1169,5 +1170,14 @@ _C_LABEL(codepatch_begin):
>  
>       .section .codepatchend,"a"
>       .globl _C_LABEL(codepatch_end)
>  _C_LABEL(codepatch_end):
>       .previous
> +
> +#if NXEN > 0
> +     /* Hypercall_page needs to be PAGE aligned */
> +     .text
> +     .align  NBPG
> +     .globl  _C_LABEL(xen_hypercall_page)
> +_C_LABEL(xen_hypercall_page):
> +     .skip   0x1000, 0x90    /* Fill with NOPs */
> +#endif /* NXEN > 0 */
> -- 
> 2.6.3
> 

Reply via email to