historical-speck.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v5 6/8] NX 6
Date: Wed, 09 Oct 2019 23:42:51 +0100	[thread overview]
Message-ID: <973c85efc96c05cba9ddfc2f5bf53c9482801924.camel@decadent.org.uk> (raw)
In-Reply-To: <1561989149-17323-7-git-send-email-pbonzini@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

On Mon, 2019-07-01 at 15:52 +0200, speck for Paolo Bonzini wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 6/8] kvm: mmu: ITLB_MULTIHIT mitigation
[...]
> +static int set_nx_huge_pages(const char *val, const struct kernel_param *kp)
> +{
> +	bool old_val = nx_huge_pages;
> +	bool new_val;
> +
> +	/* In "auto" mode deploy workaround only if CPU has the bug. */
> +	if (sysfs_streq(val, "off"))
> +		new_val = 0;
> +	else if (sysfs_streq(val, "force"))
> +		new_val = 1;
> +	else if (sysfs_streq(val, "auto"))
> +		new_val = boot_cpu_has_bug(X86_BUG_ITLB_MULTIHIT);
> +	else if (strtobool(val, &new_val) < 0)
> +		return -EINVAL;
> +
> +	__set_nx_huge_pages(new_val);
> +
> +	if (new_val != old_val) {
> +		struct kvm *kvm;
> +		int idx;
> +
> +		mutex_lock(&kvm_lock);
> +
> +		list_for_each_entry(kvm, &vm_list, vm_list) {
> +			idx = srcu_read_lock(&kvm->srcu);
> +			kvm_mmu_zap_all(kvm);
> +			srcu_read_unlock(&kvm->srcu, idx);
> +		}
> +		mutex_unlock(&kvm_lock);
> +	}
[...]

I've started trying to backport the NX patches to stable branches, and
I think I can take them back as far as 4.9.

However, kvm_mmu_zap_all() is a relatively new addition and looks hard
to backport.  I intend to make the nx_huge_pages parameter read-only
(0444 permissions) and delete this "if (new_val != old_val)" block. 
Does that seem reasonable?

Ben.

-- 
Ben Hutchings
Humans are not rational beings; they are rationalising beings.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2019-10-09 22:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1561989149-17323-1-git-send-email-pbonzini@redhat.com>
     [not found] ` <1561989149-17323-9-git-send-email-pbonzini@redhat.com>
     [not found]   ` <8eab605b-df0e-74d0-e448-986149edf33e@redhat.com>
2019-10-02 20:38     ` [MODERATED] Re: [PATCH v5 8/8] NX 8 Pawan Gupta
2019-10-02 20:59       ` Paolo Bonzini
2019-10-07 19:45         ` Pawan Gupta
2019-10-09  6:13           ` Paolo Bonzini
2019-10-09 14:41             ` Pawan Gupta
2019-10-09 15:10               ` Paolo Bonzini
2019-10-10  5:53                 ` Pawan Gupta
2019-10-10 16:14                   ` Paolo Bonzini
2019-10-10 16:50                     ` Paolo Bonzini
2019-10-10 17:37                       ` Paolo Bonzini
     [not found] ` <1561989149-17323-7-git-send-email-pbonzini@redhat.com>
     [not found]   ` <alpine.DEB.2.21.1907022244530.1802@nanos.tec.linutronix.de>
     [not found]     ` <4c4447ba-838d-cd85-f35b-468508437b61@intel.com>
     [not found]       ` <alpine.DEB.2.21.1907022303250.1802@nanos.tec.linutronix.de>
2019-10-09  0:14         ` [MODERATED] Re: [PATCH v5 6/8] NX 6 Pawan Gupta
2019-10-09 22:42   ` Ben Hutchings [this message]
2019-10-09 22:52     ` Junaid Shahid
2019-10-09 23:05       ` Ben Hutchings
2019-10-09 23:03     ` Kanth Ghatraju
2019-10-09 23:08     ` Paolo Bonzini
2019-10-09 23:20       ` Kanth Ghatraju
2019-10-31 22:54         ` [MODERATED] NX backports (was Re: [PATCH v5 6/8] NX 6) Paolo Bonzini
2019-10-13 22:11       ` [MODERATED] Re: [PATCH v5 6/8] NX 6 Ben Hutchings
2019-10-14  6:57         ` Paolo Bonzini
2019-11-04 19:43         ` mark gross
2019-11-05 12:28           ` [MODERATED] Re: ***UNCHECKED*** " Michal Hocko
2019-11-05 14:53             ` mark gross
2019-11-05 17:03               ` mark gross
2019-10-14 20:46     ` [MODERATED] " Pawan Gupta
2019-10-15  6:24       ` Greg KH
2019-10-15 10:46         ` Jiri Kosina
2019-10-15 21:19           ` Pawan Gupta
2019-10-17 23:50       ` Ben Hutchings
     [not found] ` <1561989149-17323-2-git-send-email-pbonzini@redhat.com>
2019-10-09 23:01   ` [MODERATED] Re: [PATCH v5 1/8] NX 1 Ben Hutchings
2019-10-10  1:33     ` Pawan Gupta

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=973c85efc96c05cba9ddfc2f5bf53c9482801924.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=speck@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).