All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	Tim Deegan <tim@xen.org>, Keir Fraser <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH xen-4.6] xen: Remove CONFIG_X86_SUPERVISOR_MODE_KERNEL as x86_32 builds are unsupported
Date: Mon, 5 Jan 2015 15:35:27 +0000	[thread overview]
Message-ID: <54AAAF3F.7020706@citrix.com> (raw)
In-Reply-To: <1420470993.28863.31.camel@citrix.com>

On 05/01/15 15:16, Ian Campbell wrote:
> On Fri, 2015-01-02 at 19:12 +0000, Andrew Cooper wrote:
>> supervisor_mode_kernel was an x86_32-only feature which permitted a PV dom0 to
>> run in ring 0, but at the expense of not being able to start any domUs.
>>
>> As the x86_32 Xen build has been removed from tree, removing the remaining
>> supervisor_mode_kernel code.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Ian Campbell <ian.campbell@citrix.com>
>> CC: Stefano Stabellini <stefano.stabellini@citrix.com>
>> CC: Tim Deegan <tim@xen.org>
>>
>> ---
>>
>> One complication is that PVH has reused XENFEAT_supervisor_mode_kernel with a
>> modified meaning, and the Linux PVH code actively uses the flag as to indicate
>> running as a PVH guest.
> What is the modification? Doesn't a PVH kernel just use it to indicate
> that it should (or wants) run in ring0 instead of ring1/ring3? That was
> the original intention IIRC.
>
> Regardless, supervisor_mode_kernel was never anything more than a
> prototype, I'm pretty certain there can be no kernels out there relying
> on it, so rather than breaking pvh dom0 as you seem to do here I think
> it would be better to retcon the meaning of the flag as needed.
>
>> This causes an discontinuity between PVH and HVM guests, both of which run
>> their kernels with the PVH-taken meaning of XENFEAT_supervisor_mode_kernel.
>>
>> It also means that a dom0 kernel is unable to express "PVH-only" by requiring
>> this feature, as a 64bit Xen will validly reject an attempt to require a
>> 32bit-only Xen feature.
> I wouldn't describe XENFEAT_supervisor_mode_kernel as a "32-bit only Xen
> feature". It was only ever implemented for 32-bit, but conceptually it
> isn't specific to 32-bit but to any setup where PV requires you to run
> the kernel at a lower then normal privilege level.

Answering out-of-order

This patch has no functional change WRT PVH.  The hunk commented on is
simply changed via indentation due to the removal of the conditional it
is in.  It was never been possible for a PVH kernel boot with
"!XENFEAT_supervisor_mode_kernel" in its feature string.

If retcon'ing this feature flag is acceptable then the problem goes
away, as can the commented hunk.  However, given the meaning of the
flag, it really should be advertised to plain HVM guests as well,
because their kernel does run in ring0.  At that point, it becomes more
of a general "running in an hvm container" flag.

What usecase was supervisor_mode_kernel developed for?  It seems
counter-intuitive, but I can't find anything in the history explaining
its use.

~Andrew

  reply	other threads:[~2015-01-05 15:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02 19:12 [PATCH xen-4.6] xen: Remove CONFIG_X86_SUPERVISOR_MODE_KERNEL as x86_32 builds are unsupported Andrew Cooper
2015-01-05 11:21 ` Tim Deegan
2015-01-05 15:16 ` Ian Campbell
2015-01-05 15:35   ` Andrew Cooper [this message]
2015-01-05 15:41     ` Ian Campbell
2015-01-05 16:07       ` Andrew Cooper
2015-01-05 16:16         ` Ian Campbell
2015-01-06  2:22     ` Mukesh Rathor

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=54AAAF3F.7020706@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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.