Skip to contentSkip to conversation

Make hvm_fep available to non-debug builds

RFC PATCH Superseded Wei Liu 4 participants 13 messages Jun 15, 2016 – Jun 16, 2016

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover Make hvm_fep available to non-debug builds

Wei Liu (2):
xen/kernel: document 'C' in print_tainted
xen: make available hvm_fep to non-debug build as well

 docs/misc/xen-command-line.markdown |  8 ++++++--
 xen/arch/x86/hvm/hvm.c              | 31 ++++++++++++++++++++++++++++---
 xen/common/kernel.c                 |  7 +++++--
 xen/include/asm-x86/hvm/hvm.h       |  4 ----
 xen/include/xen/lib.h               |  1 +
 5 files changed, 40 insertions(+), 11 deletions(-)
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#1 lore raw

RFC PATCH 1/2 xen/kernel: document 'C' in print_tainted

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 xen/common/kernel.c | 1 +
 1 file changed, 1 insertion(+)
xen/common/kernel.c +1 -0
index 1a6823a..dae7e35 100644
@@ -174,6 +174,7 @@ int __init parse_bool(const char *s)
  *  'S' - SMP with CPUs not designed for SMP.
  *  'M' - Machine had a machine check experience.
  *  'B' - System has hit bad_page.
+ *  'C' - Console output is synchronous.
  *
  *      The string is overwritten by the next call to print_taint().
  */
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#3 lore raw

RFC PATCH 2/2 xen: make available hvm_fep to non-debug build as well

In reply to Wei Liu

Originally hvm_fep was guarded by NDEBUG, which means it was only available to debug builds.

However there is value to have it for non-debug builds as well. User can use that to run tests in setup that replicates production setup.

Make it clear with a sync_console style warning that this option can't be used in production setup. Update command line documentation accordingly. Finally mark Xen as tainted when this option is enabled.

---
Cc: Andrew Cooper <[email protected]>
Cc: Jan Beulich <[email protected]>

---
 docs/misc/xen-command-line.markdown |  8 ++++++--
 xen/arch/x86/hvm/hvm.c              | 31 ++++++++++++++++++++++++++++---
 xen/common/kernel.c                 |  6 ++++--
 xen/include/asm-x86/hvm/hvm.h       |  4 ----
 xen/include/xen/lib.h               |  1 +
 5 files changed, 39 insertions(+), 11 deletions(-)
docs/misc/xen-command-line.markdown +6 -2
index fed732c..dc53e24 100644
@@ -878,8 +878,12 @@ Recognized in debug builds of the hypervisor only.
 Allow use of the Forced Emulation Prefix in HVM guests, to allow emulation of
 arbitrary instructions.
 
-This option is intended for development purposes, and is only available in
-debug builds of the hypervisor.
+This option is intended for development and testing purposes.
+
+*Warning*
+As this feature opens up the instruction emulator to HVM guest, don't
+use this in production system. No security support is provided when
+this flag is set.
 
 ### hvm\_port80
 > `= <boolean>`
xen/arch/x86/hvm/hvm.c +28 -3
index 78db903..5bafaef 100644
@@ -37,6 +37,7 @@
 #include <xen/mem_access.h>
 #include <xen/rangeset.h>
 #include <xen/vm_event.h>
+#include <xen/delay.h>
 #include <asm/shadow.h>
 #include <asm/hap.h>
 #include <asm/current.h>
@@ -95,11 +96,9 @@ unsigned long __section(".bss.page_aligned")
 static bool_t __initdata opt_hap_enabled = 1;
 boolean_param("hap", opt_hap_enabled);
 
-#ifndef opt_hvm_fep
 /* Permit use of the Forced Emulation Prefix in HVM guests */
-bool_t opt_hvm_fep;
+bool_t __read_mostly opt_hvm_fep;
 boolean_param("hvm_fep", opt_hvm_fep);
-#endif
 
 /* Xen command-line option to enable altp2m */
 static bool_t __initdata opt_altp2m_enabled = 0;
@@ -182,6 +181,32 @@ static int __init hvm_enable(void)
     if ( !opt_altp2m_enabled )
         hvm_funcs.altp2m_supported = 0;
 
+    if ( opt_hvm_fep )
+    {
+        unsigned i, j;
+
+        printk("**********************************************\n");
+        printk("******* WARNING: HVM FORCED EMULATION PREFIX IS PERMITTED\n");
+        printk("******* This option is *ONLY* intended to aid debugging "
+               "and testing of Xen\n");
+        printk("******* that HVM guest can enter instruction emulator "
+               "with UD instruction.\n");
+        printk("******* It has implication on the security of the system.\n");
+        printk("******* Please *DO NOT* use this in production.\n");
+        printk("**********************************************\n");
+        add_taint(TAINT_HVM_FEP);
+        for ( i = 0; i < 3; i++ )
+        {
+            printk("%d... ", 3-i);
+            for ( j = 0; j < 100; j++ )
+            {
+                process_pending_softirqs();
+                mdelay(10);
+            }
+        }
+        printk("\n");
+    }
+
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
      * often used for I/O delays, but the vmexits simply slow things down).
xen/common/kernel.c +4 -2
index dae7e35..5bf77aa 100644
@@ -175,6 +175,7 @@ int __init parse_bool(const char *s)
  *  'M' - Machine had a machine check experience.
  *  'B' - System has hit bad_page.
  *  'C' - Console output is synchronous.
+ *  'H' - HVM forced emulation prefix is permitted.
  *
  *      The string is overwritten by the next call to print_taint().
  */
@@ -182,11 +183,12 @@ char *print_tainted(char *str)
 {
     if ( tainted )
     {
-        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c",
+        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c%c",
                  tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
                  tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
                  tainted & TAINT_BAD_PAGE ? 'B' : ' ',
-                 tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ');
+                 tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ',
+                 tainted & TAINT_HVM_FEP ? 'H' : ' ');
     }
     else
     {
xen/include/asm-x86/hvm/hvm.h +0 -4
index f486ee9..217112d 100644
@@ -27,12 +27,8 @@
 #include <public/hvm/save.h>
 #include <xen/mm.h>
 
-#ifndef NDEBUG
 /* Permit use of the Forced Emulation Prefix in HVM guests */
 extern bool_t opt_hvm_fep;
-#else
-#define opt_hvm_fep 0
-#endif
 
 /* Interrupt acknowledgement sources. */
 enum hvm_intsrc {
xen/include/xen/lib.h +1 -0
index 1c652bb..b1b0fb2 100644
@@ -142,6 +142,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 #define TAINT_BAD_PAGE                  (1<<2)
 #define TAINT_SYNC_CONSOLE              (1<<3)
 #define TAINT_ERROR_INJECT              (1<<4)
+#define TAINT_HVM_FEP                   (1<<5)
 extern int tainted;
 #define TAINT_STRING_MAX_LEN            20
 extern char *print_tainted(char *str);
Signature · 7 lines
2.1.4


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

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

Quoted 131 lines · Wei Liu

Originally hvm_fep was guarded by NDEBUG, which means it was only available to debug builds.

However there is value to have it for non-debug builds as well. User can use that to run tests in setup that replicates production setup.

Make it clear with a sync_console style warning that this option can't be used in production setup. Update command line documentation accordingly. Finally mark Xen as tainted when this option is enabled.

---
Cc: Andrew Cooper <[email protected]>
Cc: Jan Beulich <[email protected]>

---
 docs/misc/xen-command-line.markdown |  8 ++++++--
 xen/arch/x86/hvm/hvm.c              | 31 ++++++++++++++++++++++++++++---
 xen/common/kernel.c                 |  6 ++++--
 xen/include/asm-x86/hvm/hvm.h       |  4 ----
 xen/include/xen/lib.h               |  1 +
 5 files changed, 39 insertions(+), 11 deletions(-)
docs/misc/xen-command-line.markdown +6 -2
index fed732c..dc53e24 100644
@@ -878,8 +878,12 @@ Recognized in debug builds of the hypervisor only.
 Allow use of the Forced Emulation Prefix in HVM guests, to allow emulation of
 arbitrary instructions.
 
-This option is intended for development purposes, and is only available in
-debug builds of the hypervisor.
+This option is intended for development and testing purposes.
+
+*Warning*
+As this feature opens up the instruction emulator to HVM guest, don't
+use this in production system. No security support is provided when
+this flag is set.
 
 ### hvm\_port80
 > `= <boolean>`
xen/arch/x86/hvm/hvm.c +28 -3
index 78db903..5bafaef 100644
@@ -37,6 +37,7 @@
 #include <xen/mem_access.h>
 #include <xen/rangeset.h>
 #include <xen/vm_event.h>
+#include <xen/delay.h>
 #include <asm/shadow.h>
 #include <asm/hap.h>
 #include <asm/current.h>
@@ -95,11 +96,9 @@ unsigned long __section(".bss.page_aligned")
 static bool_t __initdata opt_hap_enabled = 1;
 boolean_param("hap", opt_hap_enabled);
 
-#ifndef opt_hvm_fep
 /* Permit use of the Forced Emulation Prefix in HVM guests */
-bool_t opt_hvm_fep;
+bool_t __read_mostly opt_hvm_fep;
 boolean_param("hvm_fep", opt_hvm_fep);
-#endif
 
 /* Xen command-line option to enable altp2m */
 static bool_t __initdata opt_altp2m_enabled = 0;
@@ -182,6 +181,32 @@ static int __init hvm_enable(void)
     if ( !opt_altp2m_enabled )
         hvm_funcs.altp2m_supported = 0;
 
+    if ( opt_hvm_fep )
+    {
+        unsigned i, j;
+
+        printk("**********************************************\n");
+        printk("******* WARNING: HVM FORCED EMULATION PREFIX IS PERMITTED\n");
+        printk("******* This option is *ONLY* intended to aid debugging "
+               "and testing of Xen\n");
+        printk("******* that HVM guest can enter instruction emulator "
+               "with UD instruction.\n");
+        printk("******* It has implication on the security of the system.\n");
+        printk("******* Please *DO NOT* use this in production.\n");
+        printk("**********************************************\n");
+        add_taint(TAINT_HVM_FEP);
+        for ( i = 0; i < 3; i++ )
+        {
+            printk("%d... ", 3-i);
+            for ( j = 0; j < 100; j++ )
+            {
+                process_pending_softirqs();
+                mdelay(10);
+            }
+        }
+        printk("\n");
+    }
+
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
      * often used for I/O delays, but the vmexits simply slow things down).
xen/common/kernel.c +4 -2
index dae7e35..5bf77aa 100644
@@ -175,6 +175,7 @@ int __init parse_bool(const char *s)
  *  'M' - Machine had a machine check experience.
  *  'B' - System has hit bad_page.
  *  'C' - Console output is synchronous.
+ *  'H' - HVM forced emulation prefix is permitted.
  *
  *      The string is overwritten by the next call to print_taint().
  */
@@ -182,11 +183,12 @@ char *print_tainted(char *str)
 {
     if ( tainted )
     {
-        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c",
+        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c%c",
                  tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
                  tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
                  tainted & TAINT_BAD_PAGE ? 'B' : ' ',
-                 tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ');
+                 tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ',
+                 tainted & TAINT_HVM_FEP ? 'H' : ' ');
     }
     else
     {
xen/include/asm-x86/hvm/hvm.h +0 -0
index f486ee9..217112d 100644

xen/include/asm-x86/hvm/hvm.h line 35

Quoted 9 lines
xen/include/asm-x86/hvm/hvm.h +0 -4
@@ -27,12 +27,8 @@
 #include <public/hvm/save.h>
 #include <xen/mm.h>
 
-#ifndef NDEBUG
 /* Permit use of the Forced Emulation Prefix in HVM guests */
 extern bool_t opt_hvm_fep;
-#else
-#define opt_hvm_fep 0
-#endif

Please instead add this as a Kconfig option and you can default it to enabled.

Quoted 16 lines
xen/include/asm-x86/hvm/hvm.h +0 -0
 /* Interrupt acknowledgement sources. */
 enum hvm_intsrc {
xen/include/xen/lib.h +1 -0
index 1c652bb..b1b0fb2 100644
@@ -142,6 +142,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 #define TAINT_BAD_PAGE                  (1<<2)
 #define TAINT_SYNC_CONSOLE              (1<<3)
 #define TAINT_ERROR_INJECT              (1<<4)
+#define TAINT_HVM_FEP                   (1<<5)
 extern int tainted;
 #define TAINT_STRING_MAX_LEN            20
 extern char *print_tainted(char *str);
Signature · 1 line
Doug Goldstein

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

author
#5 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

Quoted 1 line · Doug Goldstein

On 6/15/16 9:31 AM, Wei Liu wrote:

[...]

Quoted 10 lines

xen/include/asm-x86/hvm/hvm.h line 35

Quoted 6 lines
xen/include/asm-x86/hvm/hvm.h +0 -4
-#ifndef NDEBUG
 /* Permit use of the Forced Emulation Prefix in HVM guests */
 extern bool_t opt_hvm_fep;
-#else
-#define opt_hvm_fep 0
-#endif

Please instead add this as a Kconfig option and you can default it to enabled.

Sure, it is reasonable that you want to compile this out.

But which section does it belong to? Architecture Features I guess?

Wei.

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

#6 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

Quoted 14 lines · Wei Liu
Quoted 1 line · Doug Goldstein

On 6/15/16 9:31 AM, Wei Liu wrote:

[...]

Quoted 10 lines

xen/include/asm-x86/hvm/hvm.h line 35

Quoted 6 lines
xen/include/asm-x86/hvm/hvm.h +0 -4
-#ifndef NDEBUG
 /* Permit use of the Forced Emulation Prefix in HVM guests */
 extern bool_t opt_hvm_fep;
-#else
-#define opt_hvm_fep 0
-#endif

Please instead add this as a Kconfig option and you can default it to enabled.

Quoted 6 lines

Sure, it is reasonable that you want to compile this out.

But which section does it belong to? Architecture Features I guess?

Wei.

That sounds reasonable to me. You can add it to arch/Kconfig if it makes sense for both ARM and x86.

Signature · 1 line
Doug Goldstein

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

author
#7 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

Quoted 17 lines · Doug Goldstein
Quoted 16 lines · Wei Liu
Quoted 1 line · Doug Goldstein

On 6/15/16 9:31 AM, Wei Liu wrote:

[...]

Quoted 10 lines

xen/include/asm-x86/hvm/hvm.h line 35

Quoted 6 lines
xen/include/asm-x86/hvm/hvm.h +0 -4
-#ifndef NDEBUG
 /* Permit use of the Forced Emulation Prefix in HVM guests */
 extern bool_t opt_hvm_fep;
-#else
-#define opt_hvm_fep 0
-#endif

Please instead add this as a Kconfig option and you can default it to enabled.

Sure, it is reasonable that you want to compile this out.

Quoted 8 lines
Quoted 4 lines

But which section does it belong to? Architecture Features I guess?

Wei.

That sounds reasonable to me. You can add it to arch/Kconfig if it makes sense for both ARM and x86.

I think it should be x86 only for now. ARM doesn't have instruction emulator.

Wei.

Quoted 3 lines
Signature · 1 line
Doug Goldstein

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

#8 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

In reply to Wei Liu

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

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.06.16 at 16:31, <[email protected]> wrote:
xen/arch/x86/hvm/hvm.c +3 -0
@@ -182,6 +181,32 @@ static int __init hvm_enable(void)
     if ( !opt_altp2m_enabled )
         hvm_funcs.altp2m_supported = 0;
 
+    if ( opt_hvm_fep )
+    {
+        unsigned i, j;

unsigned int

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

Quoted 10 lines
xen/arch/x86/hvm/hvm.c +10 -0
+        printk("**********************************************\n");
+        printk("******* WARNING: HVM FORCED EMULATION PREFIX IS PERMITTED\n");
+        printk("******* This option is *ONLY* intended to aid debugging "
+               "and testing of Xen\n");
+        printk("******* that HVM guest can enter instruction emulator "
+               "with UD instruction.\n");
+        printk("******* It has implication on the security of the system.\n");
+        printk("******* Please *DO NOT* use this in production.\n");
+        printk("**********************************************\n");
+        add_taint(TAINT_HVM_FEP);

Should we perhaps taint the system only the first time a guest makes use of this?

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

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +3 -0
+        for ( i = 0; i < 3; i++ )
+        {
+            printk("%d... ", 3-i);

%u and spaces around - please.

Jan

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

author
#9 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

Quoted 11 lines · Jan Beulich

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

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.06.16 at 16:31, <[email protected]> wrote:
xen/arch/x86/hvm/hvm.c +3 -0
@@ -182,6 +181,32 @@ static int __init hvm_enable(void)
     if ( !opt_altp2m_enabled )
         hvm_funcs.altp2m_supported = 0;
 
+    if ( opt_hvm_fep )
+    {
+        unsigned i, j;

unsigned int

Ack.

Quoted 11 lines

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

Quoted 10 lines
xen/arch/x86/hvm/hvm.c +10 -0
+        printk("**********************************************\n");
+        printk("******* WARNING: HVM FORCED EMULATION PREFIX IS PERMITTED\n");
+        printk("******* This option is *ONLY* intended to aid debugging "
+               "and testing of Xen\n");
+        printk("******* that HVM guest can enter instruction emulator "
+               "with UD instruction.\n");
+        printk("******* It has implication on the security of the system.\n");
+        printk("******* Please *DO NOT* use this in production.\n");
+        printk("**********************************************\n");
+        add_taint(TAINT_HVM_FEP);
Quoted 3 lines

Should we perhaps taint the system only the first time a guest makes use of this?

Doesn't that add overhead to a potential hot path? Arguably it is only setting a bit in a flag, but still...

Quoted 6 lines

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

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +3 -0
+        for ( i = 0; i < 3; i++ )
+        {
+            printk("%d... ", 3-i);

%u and spaces around - please.

Ack.

Wei.

Quoted 2 lines

Jan

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

#10 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

Quoted 3 lines · Wei Liu
Quoted 3 lines

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

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +2 -0
+        printk("**********************************************\n");
+        printk("******* WARNING: HVM FORCED EMULATION PREFIX IS PERMITTED\n");

I would say "available" rather than permitted in this case.

Quoted 2 lines
Quoted 2 lines

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

Quoted 2 lines
xen/arch/x86/hvm/hvm.c +2 -0
+        printk("******* This option is *ONLY* intended to aid debugging "
+               "and testing of Xen\n");

Despite the line length, I would keep this string on a single line. If you want it a little shorter, you can drop "debugging and", leaving just testing.

Quoted 2 lines
Quoted 2 lines

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

Quoted 2 lines
xen/arch/x86/hvm/hvm.c +2 -0
+        printk("******* that HVM guest can enter instruction emulator "
+               "with UD instruction.\n");

I think this like isn't necessary. Anyone who is unclear what FEP is can look it up.

Quoted 1 line
Quoted 1 line
Quoted 1 line

+ printk("******* It has implication on the security of the system.\n");

implications.

Quoted 8 lines
Quoted 6 lines

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

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +3 -0
+        printk("******* Please *DO NOT* use this in production.\n");
+        printk("**********************************************\n");
+        add_taint(TAINT_HVM_FEP);

Should we perhaps taint the system only the first time a guest makes use of this?

Doesn't that add overhead to a potential hot path? Arguably it is only setting a bit in a flag, but still...

FEP is not a fastpath at all. It would be fine to defer to hvm_ud_intercept().

~Andrew

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

author
#11 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

Quoted 17 lines · Andrew Cooper
Quoted 3 lines · Wei Liu
Quoted 3 lines

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

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +2 -0
+        printk("**********************************************\n");
+        printk("******* WARNING: HVM FORCED EMULATION PREFIX IS PERMITTED\n");

I would say "available" rather than permitted in this case.

Quoted 2 lines
Quoted 2 lines

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

Quoted 2 lines
xen/arch/x86/hvm/hvm.c +2 -0
+        printk("******* This option is *ONLY* intended to aid debugging "
+               "and testing of Xen\n");

Despite the line length, I would keep this string on a single line. If you want it a little shorter, you can drop "debugging and", leaving just testing.

Quoted 2 lines
Quoted 2 lines

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

Quoted 2 lines
xen/arch/x86/hvm/hvm.c +2 -0
+        printk("******* that HVM guest can enter instruction emulator "
+               "with UD instruction.\n");
Quoted 7 lines

I think this like isn't necessary. Anyone who is unclear what FEP is can look it up.

Quoted 1 line
Quoted 1 line
Quoted 1 line

+ printk("******* It has implication on the security of the system.\n");

implications.

All fixed.

Quoted 12 lines
Quoted 8 lines
Quoted 6 lines

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

Quoted 3 lines
xen/arch/x86/hvm/hvm.c +3 -0
+        printk("******* Please *DO NOT* use this in production.\n");
+        printk("**********************************************\n");
+        add_taint(TAINT_HVM_FEP);

Should we perhaps taint the system only the first time a guest makes use of this?

Doesn't that add overhead to a potential hot path? Arguably it is only setting a bit in a flag, but still...

FEP is not a fastpath at all. It would be fine to defer to hvm_ud_intercept().

NP.

Wei.

Quoted 1 line

~Andrew

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

#12 lore raw

Re: [PATCH RFC 2/2] xen: make available hvm_fep to non-debug build as well

In reply to Wei Liu
Quoted 14 lines
Quoted 1 line
Quoted 1 line · On 16.06.16 at 13:52, <[email protected]> wrote:
Quoted 12 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 15.06.16 at 16:31, <[email protected]> wrote:
xen/arch/x86/hvm/hvm.c +10 -0
+        printk("**********************************************\n");
+        printk("******* WARNING: HVM FORCED EMULATION PREFIX IS PERMITTED\n");
+        printk("******* This option is *ONLY* intended to aid debugging "
+               "and testing of Xen\n");
+        printk("******* that HVM guest can enter instruction emulator "
+               "with UD instruction.\n");
+        printk("******* It has implication on the security of the system.\n");
+        printk("******* Please *DO NOT* use this in production.\n");
+        printk("**********************************************\n");
+        add_taint(TAINT_HVM_FEP);
Quoted 6 lines
Quoted 3 lines

Should we perhaps taint the system only the first time a guest makes use of this?

Doesn't that add overhead to a potential hot path? Arguably it is only setting a bit in a flag, but still...

How can that be a hot path, if it's not even usable without the option set?

Jan

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