WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux-2.6.18: add privileged/unprivileged kernel fea

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux-2.6.18: add privileged/unprivileged kernel feature indication
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Tue, 05 Jul 2011 14:16:29 +0100
Delivery-date: Tue, 05 Jul 2011 06:17:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This is the kernel side change accompanying the earlier sent Xen side
patch titled identically.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/arch/i386/kernel/head-xen.S
+++ b/arch/i386/kernel/head-xen.S
@@ -137,6 +137,12 @@ ENTRY(cpu_gdt_table)
        .quad 0x0000000000000000        /* 0xf0 - unused */
        .quad 0x0000000000000000        /* 0xf8 - GDT entry 31: double-fault 
TSS */
 
+#ifdef CONFIG_XEN_UNPRIVILEGED_GUEST
+# define XEN_PRIV_CAP "!unprivileged"
+#else
+# define XEN_PRIV_CAP "privileged|unprivileged"
+#endif
+
 #if CONFIG_XEN_COMPAT <= 0x030002
 /*
  * __xen_guest information
@@ -163,7 +169,8 @@ ENTRY(cpu_gdt_table)
                utoa (__PAGE_OFFSET + __PHYSICAL_START + VIRT_ENTRY_OFFSET)
        .ascii  ",HYPERCALL_PAGE=0x"
                utoa ((__PHYSICAL_START+HYPERCALL_PAGE_OFFSET)>>PAGE_SHIFT)
-       .ascii  ",FEATURES=writable_page_tables"
+       .ascii  ",FEATURES=" XEN_PRIV_CAP
+       .ascii           "|writable_page_tables"
        .ascii           "|writable_descriptor_tables"
        .ascii           "|auto_translated_physmap"
        .ascii           "|pae_pgdir_above_4gb"
@@ -190,7 +197,12 @@ ENTRY(cpu_gdt_table)
        ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .long,  startup_32)
        ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long,  hypercall_page)
        ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   .long,  HYPERVISOR_VIRT_START)
-       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, 
"writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel")
+       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .ascii, XEN_PRIV_CAP;
+                                                .ascii  
"|writable_page_tables";
+                                                .ascii  
"|writable_descriptor_tables";
+                                                .ascii  
"|auto_translated_physmap";
+                                                .ascii  "|pae_pgdir_above_4gb";
+                                                .asciz  
"|supervisor_mode_kernel")
 #ifdef CONFIG_X86_PAE
        ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz, "yes")
        ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  
_PAGE_PRESENT,_PAGE_PRESENT)
--- a/arch/x86_64/kernel/head-xen.S
+++ b/arch/x86_64/kernel/head-xen.S
@@ -160,6 +160,12 @@ gdt_end:
 ENTRY(empty_zero_page)
        .skip PAGE_SIZE
 
+#ifdef CONFIG_XEN_UNPRIVILEGED_GUEST
+# define XEN_PRIV_CAP "!unprivileged"
+#else
+# define XEN_PRIV_CAP "privileged|unprivileged"
+#endif
+
 #if CONFIG_XEN_COMPAT <= 0x030002
 /*
  * __xen_guest information
@@ -186,7 +192,8 @@ ENTRY(empty_zero_page)
                utoh (__START_KERNEL_map + __PHYSICAL_START)
        .ascii  ",HYPERCALL_PAGE=0x"
                utoh (phys_hypercall_page >> PAGE_SHIFT)
-       .ascii  ",FEATURES=writable_page_tables"
+       .ascii  ",FEATURES=" XEN_PRIV_CAP
+       .ascii           "|writable_page_tables"
        .ascii           "|writable_descriptor_tables"
        .ascii           "|auto_translated_physmap"
        .ascii           "|supervisor_mode_kernel"
@@ -206,6 +213,10 @@ ENTRY(empty_zero_page)
        ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          .quad,  startup_64)
        ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad,  hypercall_page)
        ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,   .quad,  
_PAGE_PRESENT,_PAGE_PRESENT)
-       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz, 
"writable_page_tables|writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel")
+       ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .ascii, XEN_PRIV_CAP;
+                                                .ascii "|writable_page_tables";
+                                                .ascii 
"|writable_descriptor_tables";
+                                                .ascii 
"|auto_translated_physmap";
+                                                .asciz 
"|supervisor_mode_kernel")
        ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz, "generic")
        ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long,  1)



Attachment: xen-kernel-cap.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux-2.6.18: add privileged/unprivileged kernel feature indication, Jan Beulich <=