All of lore.kernel.org
 help / color / mirror / Atom feed
From: bp@alien8.de (Borislav Petkov)
To: cocci@systeme.lip6.fr
Subject: [Cocci] [PATCH v2 3/3] paravirt: rename paravirt_enabled to paravirt_legacy
Date: Sat, 6 Feb 2016 23:04:37 +0100	[thread overview]
Message-ID: <20160206220437.GA4435@pd.tnic> (raw)
In-Reply-To: <CALCETrWSiN+te_0aYH0NH9oBzGALLhKqxkupiGwbAm2GdCNyVQ@mail.gmail.com>

On Sat, Feb 06, 2016 at 12:05:32PM -0800, Andy Lutomirski wrote:
> int __init microcode_init(void)
> {
>         [...]
>         if (paravirt_enabled() || dis_ucode_ldr)
>                 return -EINVAL;
> 
> This is also asking "are we the natively booted kernel?"  This is
> plausibly useful for real.  (Borislav, is this actually necessary?)

There was some breakage on 32-bit pvops with that.

> Seems to me there should be a function is_native_root_kernel() or
> similar.  Obviously it could have false positives and code will have
> to deal with that.  (This also could be entirely wrong.  What code is
> responsible for CPU microcode updates on Xen?  For all I know, dom0 is
> *supposed* to apply microcode updates, in which case that check really
> should be deleted.

So there are two aspects:

- the guest loading the microcode driver. Xen should behave like
qemu+kvm does: emulate the MSR accesses the microcode loader does.

- microcode application on Xen: we've had this before. The hypervisor
should do that (if it doesn't do so already).

So yes, that paravirt_enabled() thing should go away. Even more so if we
have CPUID leaf 0x4... reserved for hypervisors.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

WARNING: multiple messages have this Message-ID (diff)
From: Borislav Petkov <bp@alien8.de>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Luis R. Rodriguez" <mcgrof@suse.com>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	cocci@systeme.lip6.fr,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	mcb30@ipxe.org, Thomas Gleixner <tglx@linutronix.de>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Joerg Roedel <joro@8bytes.org>,
	Robert Moore <robert.moore@intel.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Xen Devel <xen-devel@lists.xensource.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Jan Beulich <JBeulich@suse.com>, Lv Zheng <lv.zheng@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	long.wanglong@huawei.com, Fengguang Wu <fengguang.wu@intel.com>,
	qiuxishi@huawei.com, Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	david.e.box@intel.com, X86 ML <x86@kernel.org>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH v2 3/3] paravirt: rename paravirt_enabled to paravirt_legacy
Date: Sat, 6 Feb 2016 23:04:37 +0100	[thread overview]
Message-ID: <20160206220437.GA4435@pd.tnic> (raw)
In-Reply-To: <CALCETrWSiN+te_0aYH0NH9oBzGALLhKqxkupiGwbAm2GdCNyVQ@mail.gmail.com>

On Sat, Feb 06, 2016 at 12:05:32PM -0800, Andy Lutomirski wrote:
> int __init microcode_init(void)
> {
>         [...]
>         if (paravirt_enabled() || dis_ucode_ldr)
>                 return -EINVAL;
> 
> This is also asking "are we the natively booted kernel?"  This is
> plausibly useful for real.  (Borislav, is this actually necessary?)

There was some breakage on 32-bit pvops with that.

> Seems to me there should be a function is_native_root_kernel() or
> similar.  Obviously it could have false positives and code will have
> to deal with that.  (This also could be entirely wrong.  What code is
> responsible for CPU microcode updates on Xen?  For all I know, dom0 is
> *supposed* to apply microcode updates, in which case that check really
> should be deleted.

So there are two aspects:

- the guest loading the microcode driver. Xen should behave like
qemu+kvm does: emulate the MSR accesses the microcode loader does.

- microcode application on Xen: we've had this before. The hypervisor
should do that (if it doesn't do so already).

So yes, that paravirt_enabled() thing should go away. Even more so if we
have CPUID leaf 0x4... reserved for hypervisors.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

WARNING: multiple messages have this Message-ID (diff)
From: Borislav Petkov <bp@alien8.de>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Luis R. Rodriguez" <mcgrof@suse.com>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	cocci@systeme.lip6.fr,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	mcb30@ipxe.org, Thomas Gleixner <tglx@linutronix.de>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Joerg Roedel <joro@8bytes.org>,
	Robert Moore <robert.moore@intel.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Xen Devel <xen-devel@lists.xensource.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Jan Beulich <JBeulich@suse.com>, Lv Zheng <lv.zheng@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	long.wanglong@huawei.com, Fengguang Wu <fengguang.wu@intel.com>,
	qiuxishi@huawei.com, Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	david.e.bo
Subject: Re: [PATCH v2 3/3] paravirt: rename paravirt_enabled to paravirt_legacy
Date: Sat, 6 Feb 2016 23:04:37 +0100	[thread overview]
Message-ID: <20160206220437.GA4435@pd.tnic> (raw)
In-Reply-To: <CALCETrWSiN+te_0aYH0NH9oBzGALLhKqxkupiGwbAm2GdCNyVQ@mail.gmail.com>

On Sat, Feb 06, 2016 at 12:05:32PM -0800, Andy Lutomirski wrote:
> int __init microcode_init(void)
> {
>         [...]
>         if (paravirt_enabled() || dis_ucode_ldr)
>                 return -EINVAL;
> 
> This is also asking "are we the natively booted kernel?"  This is
> plausibly useful for real.  (Borislav, is this actually necessary?)

There was some breakage on 32-bit pvops with that.

> Seems to me there should be a function is_native_root_kernel() or
> similar.  Obviously it could have false positives and code will have
> to deal with that.  (This also could be entirely wrong.  What code is
> responsible for CPU microcode updates on Xen?  For all I know, dom0 is
> *supposed* to apply microcode updates, in which case that check really
> should be deleted.

So there are two aspects:

- the guest loading the microcode driver. Xen should behave like
qemu+kvm does: emulate the MSR accesses the microcode loader does.

- microcode application on Xen: we've had this before. The hypervisor
should do that (if it doesn't do so already).

So yes, that paravirt_enabled() thing should go away. Even more so if we
have CPUID leaf 0x4... reserved for hypervisors.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

  reply	other threads:[~2016-02-06 22:04 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06  4:30 [PATCH v2 0/3] paravirt: rebrand paravirt_enabled as paravirt_legacy Luis R. Rodriguez
2016-02-06  4:30 ` Luis R. Rodriguez
2016-02-06  4:30 ` [PATCH v2 1/3] paravirt: use bool for paravirt_enabled() and paravirt_has_feature() Luis R. Rodriguez
2016-02-06  4:30 ` [PATCH v2 2/3] paravirt: replace direct access to pv_info.paravirt_enabled Luis R. Rodriguez
2016-02-06  4:30   ` Luis R. Rodriguez
2016-02-06  4:30 ` [Cocci] [PATCH v2 3/3] paravirt: rename paravirt_enabled to paravirt_legacy Luis R. Rodriguez
2016-02-06  4:30   ` Luis R. Rodriguez
2016-02-06  4:30   ` Luis R. Rodriguez
2016-02-06  7:11   ` [Cocci] " Andy Lutomirski
2016-02-06  7:11     ` Andy Lutomirski
2016-02-06  7:11     ` Andy Lutomirski
2016-02-06  8:59     ` [Cocci] " Luis R. Rodriguez
2016-02-06  8:59       ` Luis R. Rodriguez
2016-02-06  8:59       ` Luis R. Rodriguez
2016-02-06 20:05       ` [Cocci] " Andy Lutomirski
2016-02-06 20:05         ` Andy Lutomirski
2016-02-06 20:05         ` Andy Lutomirski
2016-02-06 22:04         ` Borislav Petkov [this message]
2016-02-06 22:04           ` Borislav Petkov
2016-02-06 22:04           ` Borislav Petkov
2016-02-08 15:39           ` [Cocci] " Boris Ostrovsky
2016-02-08 15:39             ` Boris Ostrovsky
2016-02-08 15:39             ` Boris Ostrovsky
2016-02-08 15:55             ` [Cocci] " Borislav Petkov
2016-02-08 15:55               ` Borislav Petkov
2016-02-08 15:55               ` Borislav Petkov
2016-02-08 16:05               ` [Cocci] [Xen-devel] " Andrew Cooper
2016-02-08 16:05                 ` Andrew Cooper
2016-02-08 16:05                 ` Andrew Cooper
2016-02-08 16:12                 ` [Cocci] " Boris Ostrovsky
2016-02-08 16:12                   ` Boris Ostrovsky
2016-02-08 16:12                   ` Boris Ostrovsky
2016-02-08 16:26                   ` [Cocci] " Andrew Cooper
2016-02-08 16:26                     ` Andrew Cooper
2016-02-08 16:26                     ` Andrew Cooper
2016-02-08 16:31                     ` [Cocci] " Boris Ostrovsky
2016-02-08 16:31                       ` Boris Ostrovsky
2016-02-08 16:31                       ` Boris Ostrovsky
2016-02-08 16:32                       ` [Cocci] " Andrew Cooper
2016-02-08 16:32                         ` Andrew Cooper
2016-02-08 16:32                         ` Andrew Cooper
2016-02-08 16:35                       ` [Cocci] " Borislav Petkov
2016-02-08 16:35                         ` Borislav Petkov
2016-02-08 16:35                         ` Borislav Petkov
2016-02-08 16:38                         ` [Cocci] " Andrew Cooper
2016-02-08 16:38                           ` Andrew Cooper
2016-02-08 16:38                           ` Andrew Cooper
2016-02-08 16:45                           ` [Cocci] " Borislav Petkov
2016-02-08 16:45                             ` Borislav Petkov
2016-02-08 16:45                             ` Borislav Petkov
2016-02-08 16:52                             ` Boris Ostrovsky
2016-02-08 16:52                               ` Boris Ostrovsky
2016-02-08 20:45                               ` Boris Ostrovsky
2016-02-08 20:45                                 ` Boris Ostrovsky
2016-02-08 21:06                                 ` Borislav Petkov
2016-02-08 21:06                                   ` Borislav Petkov
2016-02-08 16:53                             ` [Cocci] " Andrew Cooper
2016-02-08 16:53                               ` Andrew Cooper
2016-02-08 16:53                               ` Andrew Cooper
2016-02-08 17:13                               ` Borislav Petkov
2016-02-08 17:13                                 ` Borislav Petkov
2016-02-09  6:22                               ` Luis R. Rodriguez
2016-02-09  6:22                                 ` Luis R. Rodriguez
2016-02-08 16:41                         ` [Cocci] " Boris Ostrovsky
2016-02-08 16:41                           ` Boris Ostrovsky
2016-02-08 16:41                           ` Boris Ostrovsky
2016-02-08 16:52                           ` [Cocci] " Borislav Petkov
2016-02-08 16:52                             ` Borislav Petkov
2016-02-08 16:52                             ` Borislav Petkov
2016-02-08 15:31         ` [Cocci] " Boris Ostrovsky
2016-02-08 15:31           ` Boris Ostrovsky
2016-02-08 15:31           ` Boris Ostrovsky
2016-02-08 15:46           ` [Cocci] " Borislav Petkov
2016-02-08 15:46             ` Borislav Petkov
2016-02-08 15:46             ` Borislav Petkov
2016-02-09  6:59             ` Luis R. Rodriguez
2016-02-09  6:59               ` Luis R. Rodriguez
2016-02-08 21:04           ` Andy Lutomirski
2016-02-08 21:04             ` Andy Lutomirski
2016-02-09  7:06           ` Luis R. Rodriguez
2016-02-09  7:06             ` Luis R. Rodriguez
2016-02-17 20:07             ` Luis R. Rodriguez
2016-02-17 20:49               ` Borislav Petkov
2016-02-17 20:49                 ` Borislav Petkov
2016-02-17 21:12                 ` Luis R. Rodriguez
2016-02-17 21:12                   ` Luis R. Rodriguez
2016-02-17 21:21                 ` Boris Ostrovsky
2016-02-17 21:21                   ` Boris Ostrovsky
2016-02-17 22:03                   ` Borislav Petkov
2016-02-17 22:03                     ` Borislav Petkov
2016-02-17 22:18                     ` Andy Lutomirski
2016-02-17 22:18                       ` Andy Lutomirski
2016-02-17 22:39                       ` Boris Ostrovsky
2016-02-17 22:39                         ` Boris Ostrovsky
2016-02-17 23:39                         ` Borislav Petkov
2016-02-17 23:39                           ` Borislav Petkov
2016-02-17 22:19                     ` Boris Ostrovsky
2016-02-17 22:19                       ` Boris Ostrovsky
2016-02-17 22:35                     ` Luis R. Rodriguez
2016-02-17 22:35                       ` Luis R. Rodriguez
2016-02-09  6:41         ` Luis R. Rodriguez
2016-02-09  6:41           ` Luis R. Rodriguez
2016-02-08 21:49       ` Boris Ostrovsky
2016-02-08 21:49         ` Boris Ostrovsky

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=20160206220437.GA4435@pd.tnic \
    --to=bp@alien8.de \
    --cc=cocci@systeme.lip6.fr \
    /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.