Skip to contentSkip to conversation

HAP: Add global enable/disable command line option

PATCH In review Andrew Cooper 3 participants 4 messages Jan 28, 2013 – Feb 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 HAP: Add global enable/disable command line option

Also, correct a copy&paste error in the documentation.

---

Changes since v1:
* bool_t __initdata
* tweak logic to reduce size of patch

docs/misc/xen-command-line.markdown +9 -1
diff -r 5af4f2ab06f3 -r b741ace3835a docs/misc/xen-command-line.markdown
@@ -521,6 +521,14 @@ more importance will be printed.
 The optional `<rate-limited level>` option instructs which severities
 should be rate limited.
 
+### hap
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to globally enable or disable support for Hardware Assisted
+Paging (HAP)
+
 ### hap\_1gb
 > `= <boolean>`
 
@@ -534,7 +542,7 @@ Paging (HAP).
 
 > Default: `true`
 
-Flag to enable 1 GB host page table support for Hardware Assisted
+Flag to enable 2 MB host page table support for Hardware Assisted
 Paging (HAP).
 
 ### hpetbroadcast
xen/arch/x86/hvm/hvm.c +12 -1
diff -r 5af4f2ab06f3 -r b741ace3835a xen/arch/x86/hvm/hvm.c
@@ -78,6 +78,10 @@ struct hvm_function_table hvm_funcs __re
 unsigned long __attribute__ ((__section__ (".bss.page_aligned")))
     hvm_io_bitmap[3*PAGE_SIZE/BYTES_PER_LONG];
 
+/* Xen command-line option to enable HAP */
+static bool_t __initdata opt_hap_enabled = 1;
+boolean_param("hap", opt_hap_enabled);
+
 static int cpu_callback(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
@@ -123,7 +127,14 @@ static int __init hvm_enable(void)
     hvm_enabled = 1;
 
     printk("HVM: %s enabled\n", hvm_funcs.name);
-    if ( hvm_funcs.hap_supported )
+    if ( ! hvm_funcs.hap_supported )
+        printk("HVM: Hardware Assisted Paging (HAP) not detected\n");
+    else if ( ! opt_hap_enabled )
+    {
+        hvm_funcs.hap_supported = 0;
+        printk("HVM: Hardware Assisted Paging (HAP) detected but disabled\n");
+    }
+    else
     {
         printk("HVM: Hardware Assisted Paging (HAP) detected\n");
         printk("HVM: HAP page sizes: 4kB");
#1 lore raw

Ping?

Quoted 72 lines · Andrew Cooper

Also, correct a copy&paste error in the documentation.

---

Changes since v1:
* bool_t __initdata
* tweak logic to reduce size of patch

diff -r 5af4f2ab06f3 -r b741ace3835a docs/misc/xen-command-line.markdown

docs/misc/xen-command-line.markdown +9 -1
@@ -521,6 +521,14 @@ more importance will be printed.
 The optional `<rate-limited level>` option instructs which severities
 should be rate limited.
 
+### hap
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to globally enable or disable support for Hardware Assisted
+Paging (HAP)
+
 ### hap\_1gb
 > `= <boolean>`
 
@@ -534,7 +542,7 @@ Paging (HAP).
 
 > Default: `true`
 
-Flag to enable 1 GB host page table support for Hardware Assisted
+Flag to enable 2 MB host page table support for Hardware Assisted
 Paging (HAP).
 
 ### hpetbroadcast

diff -r 5af4f2ab06f3 -r b741ace3835a xen/arch/x86/hvm/hvm.c

xen/arch/x86/hvm/hvm.c +12 -1
@@ -78,6 +78,10 @@ struct hvm_function_table hvm_funcs __re
 unsigned long __attribute__ ((__section__ (".bss.page_aligned")))
     hvm_io_bitmap[3*PAGE_SIZE/BYTES_PER_LONG];
 
+/* Xen command-line option to enable HAP */
+static bool_t __initdata opt_hap_enabled = 1;
+boolean_param("hap", opt_hap_enabled);
+
 static int cpu_callback(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
@@ -123,7 +127,14 @@ static int __init hvm_enable(void)
     hvm_enabled = 1;
 
     printk("HVM: %s enabled\n", hvm_funcs.name);
-    if ( hvm_funcs.hap_supported )
+    if ( ! hvm_funcs.hap_supported )
+        printk("HVM: Hardware Assisted Paging (HAP) not detected\n");
+    else if ( ! opt_hap_enabled )
+    {
+        hvm_funcs.hap_supported = 0;
+        printk("HVM: Hardware Assisted Paging (HAP) detected but disabled\n");
+    }
+    else
     {
         printk("HVM: Hardware Assisted Paging (HAP) detected\n");
         printk("HVM: HAP page sizes: 4kB");

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 2 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper

Ping?

As being HAP related I was assuming Tim would be taking care of this, despite the modified code not being under xen/arch/x86/mm/, or at least ack it.

Jan

Quoted 74 lines · Andrew Cooper
Quoted 52 lines

Also, correct a copy&paste error in the documentation.

---

Changes since v1:
* bool_t __initdata
* tweak logic to reduce size of patch

diff -r 5af4f2ab06f3 -r b741ace3835a docs/misc/xen-command-line.markdown

docs/misc/xen-command-line.markdown +9 -1
@@ -521,6 +521,14 @@ more importance will be printed.
 The optional `<rate-limited level>` option instructs which severities
 should be rate limited.
 
+### hap
+> `= <boolean>`
+
+> Default: `true`
+
+Flag to globally enable or disable support for Hardware Assisted
+Paging (HAP)
+
 ### hap\_1gb
 > `= <boolean>`
 
@@ -534,7 +542,7 @@ Paging (HAP).
 
 > Default: `true`
 
-Flag to enable 1 GB host page table support for Hardware Assisted
+Flag to enable 2 MB host page table support for Hardware Assisted
 Paging (HAP).
 
 ### hpetbroadcast

diff -r 5af4f2ab06f3 -r b741ace3835a xen/arch/x86/hvm/hvm.c

xen/arch/x86/hvm/hvm.c +4 -0
@@ -78,6 +78,10 @@ struct hvm_function_table hvm_funcs __re
 unsigned long __attribute__ ((__section__ (".bss.page_aligned")))
     hvm_io_bitmap[3*PAGE_SIZE/BYTES_PER_LONG];
 
+/* Xen command-line option to enable HAP */
+static bool_t __initdata opt_hap_enabled = 1;
+boolean_param("hap", opt_hap_enabled);
+
 static int cpu_callback(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {

xen/arch/x86/hvm/hvm.c static int __init hvm_enable(void) · line 135

Quoted 10 lines
xen/arch/x86/hvm/hvm.c +6 -1
@@ -123,7 +127,14 @@ static int __init hvm_enable(void)
     hvm_enabled = 1;
 
     printk("HVM: %s enabled\n", hvm_funcs.name);
-    if ( hvm_funcs.hap_supported )
+    if ( ! hvm_funcs.hap_supported )
+        printk("HVM: Hardware Assisted Paging (HAP) not detected\n");
+    else if ( ! opt_hap_enabled )
+    {
+        hvm_funcs.hap_supported = 0;
+        printk("HVM: Hardware Assisted Paging (HAP) detected but 

disabled\n");

Quoted 10 lines
xen/arch/x86/hvm/hvm.c +2 -0
+    }
+    else
     {
         printk("HVM: Hardware Assisted Paging (HAP) detected\n");
         printk("HVM: HAP page sizes: 4kB");

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by
#3 lore raw
Quoted 6 lines · Jan Beulich
Quoted 2 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper

Ping?

As being HAP related I was assuming Tim would be taking care of this, despite the modified code not being under xen/arch/x86/mm/, or at least ack it.

Sorry, slipped under my radar.