diff mbox series

[v3] Xen missing prompt log when exec-sp=off

Message ID 20191216114206.28803-1-jnwang@suse.com (mailing list archive)
State Superseded
Headers show
Series [v3] Xen missing prompt log when exec-sp=off | expand

Commit Message

Jin Nan Wang Dec. 16, 2019, 11:42 a.m. UTC
Fix a issue when user disable ETP exec-sp, xen missed a prompt
log in dmesg.

Signed-off-by: James Wang <jnwang@suse.com>
---
 xen/arch/x86/hvm/vmx/vmx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Andrew Cooper Dec. 16, 2019, 12:17 p.m. UTC | #1
On 16/12/2019 11:49, Jan Beulich wrote:
> On 16.12.2019 12:42, Jin Nan Wang wrote:
>> Fix a issue when user disable ETP exec-sp, xen missed a prompt
>> log in dmesg.
> Thanks for fixing the style issue, but submitting v3 without
> addressing the question on the "why" etc given on v2 isn't
> overly helpful.

I agree that "why" needs answering.  I wrote the code this way for a
reason, because the enabled case is not interesting.

~Andrew
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 7970ba93e1..9dcb100210 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2495,14 +2495,14 @@  const struct hvm_function_table * __init start_vmx(void)
     {
         bool cpu_has_bug_pschange_mc = has_if_pschange_mc();
 
+        /* Default to non-executable superpages on vulnerable hardware. */
         if ( opt_ept_exec_sp == -1 )
-        {
-            /* Default to non-executable superpages on vulnerable hardware. */
             opt_ept_exec_sp = !cpu_has_bug_pschange_mc;
 
-            if ( cpu_has_bug_pschange_mc )
-                printk("VMX: Disabling executable EPT superpages due to CVE-2018-12207\n");
-        }
+        if ( opt_ept_exec_sp )
+            printk("VMX: Enable executable EPT superpages\n");
+        else 
+            printk("VMX: Disabling executable EPT superpages due to CVE-2018-12207\n");
 
         vmx_function_table.hap_supported = 1;
         vmx_function_table.altp2m_supported = 1;