All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Bowman <db@donbowman.ca>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: PATCH: setup_vmcs_config: disable TSC scaling on unlike processors
Date: Fri, 9 Dec 2016 10:12:15 -0500	[thread overview]
Message-ID: <CADJev798OQb2CGNysQP=RQGdM7eEYoZX8pjLtx5Kur7r0p4BSA@mail.gmail.com> (raw)
In-Reply-To: <20161208143206.GA22892@potion>

OK, based on previous feedback, this patch version simply ignores any
inconsistency if a knowing and trusting user wishes.

In my case, two identical processors in stepping and version and all
others have 1 flag missing (retail vs tray version of chip), but the
next person might have another flag.

Comments?

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 5382b82..264870e 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -103,6 +103,9 @@ module_param_named(enable_shadow_vmcs,
enable_shadow_vmcs, bool, S_IRUGO);
 static bool __read_mostly nested = 0;
 module_param(nested, bool, S_IRUGO);

+static bool __read_mostly ignore_inconsistency = false;
+module_param(ignore_inconsistency, bool, S_IRUGO);
+
 static u64 __read_mostly host_xss;

 static bool __read_mostly enable_pml = 1;
@@ -3449,6 +3452,7 @@ static __init int setup_vmcs_config(struct
vmcs_config *vmcs_conf)
        vmcs_conf->pin_based_exec_ctrl = _pin_based_exec_control;
        vmcs_conf->cpu_based_exec_ctrl = _cpu_based_exec_control;
        vmcs_conf->cpu_based_2nd_exec_ctrl = _cpu_based_2nd_exec_control;
+       vmcs_conf->cpu_based_2nd_exec_ctrl &= ~SECONDARY_EXEC_TSC_SCALING;
        vmcs_conf->vmexit_ctrl         = _vmexit_control;
        vmcs_conf->vmentry_ctrl        = _vmentry_control;

@@ -9202,9 +9206,11 @@ static void __init vmx_check_processor_compat(void *rtn)
        if (setup_vmcs_config(&vmcs_conf) < 0)
                *(int *)rtn = -EIO;
        if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) {
-               printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",
-                               smp_processor_id());
-               *(int *)rtn = -EIO;
+               printk(KERN_ERR "kvm: CPU %d feature inconsistency%s!\n",
+                               smp_processor_id(),
+                               ignore_inconsistency ? " -- ignored" : "");
+               if (!ignore_inconsistency)
+                       *(int *)rtn = -EIO;
        }
 }

  reply	other threads:[~2016-12-09 15:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02  2:32 PATCH: setup_vmcs_config: disable TSC scaling on unlike processors Don Bowman
2016-12-02 15:07 ` Radim Krčmář
2016-12-02 19:10   ` Don Bowman
2016-12-02 20:58     ` Don Bowman
2016-12-05 16:37       ` Radim Krčmář
2016-12-06  8:49   ` David Hildenbrand
2016-12-06  9:09     ` Paolo Bonzini
2016-12-06 11:08       ` Radim Krčmář
2016-12-07 11:37         ` David Hildenbrand
2016-12-07 15:25           ` Radim Krčmář
2016-12-08 11:46             ` David Hildenbrand
2016-12-08 14:32               ` Radim Krčmář
2016-12-09 15:12                 ` Don Bowman [this message]
2016-12-13 15:43                   ` Radim Krčmář
2016-12-14  4:07                     ` Don Bowman
2016-12-14 12:30                       ` Paolo Bonzini
2016-12-14 12:46                     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADJev798OQb2CGNysQP=RQGdM7eEYoZX8pjLtx5Kur7r0p4BSA@mail.gmail.com' \
    --to=db@donbowman.ca \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.