All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rishi <2rushikeshj@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen hiding thermal capabilities from Dom0
Date: Tue, 19 Nov 2019 10:53:29 +0530	[thread overview]
Message-ID: <CAO9XypVNhSd8hPu1nA1uP8PVCPVgW-Bs_q6gmPky6Px0-U6G+w@mail.gmail.com> (raw)
In-Reply-To: <3b8d187e-c4d5-a7a5-76c2-874db47440ee@suse.com>

On Mon, Nov 18, 2019 at 3:08 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 15.11.2019 20:19, Rishi wrote:
> > On Thu, Nov 14, 2019 at 10:05 PM Jan Beulich <jbeulich@suse.com> wrote:
> >>
> >> On 14.11.2019 17:07, Rishi wrote:
> >>> In some of our hosts, Xen is not correctly exposing processor thermal
> >>> capabilities to Dom0.
> >>> Please refer: https://bugzilla.kernel.org/show_bug.cgi?id=205347
> >>>
> >>> The flag
> >>> /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
> >>> X86_FEATURE_DTHERM (14*32+ 0)
> >>>
> >>> is returned 0 via PVOP_VCALL4 vs returns 1 via native_cpuid() call from Dom0.
> >>>
> >>> Sample output via PVCALL vs Native call.
> >>> [63291.688755] cpuid_eax 6 :  a 0
> >>> [63291.688759] native_cpuid : a 77
> >>>
> >>> Is this a bug or needs some special feature to be enabled from Xen command line?
> >>
> >> Exposing this to guests (including Dom0) would imply properly
> >> virtualizing the respective behavior. In
> >> xen/arch/x86/cpuid.c:recalculate_misc() we specifically have
> >>
> >>     p->basic.raw[0x6] = EMPTY_LEAF; /* Therm/Power not exposed to guests. */
> >>
> >> If you wanted this exposed, you'd first of all need to come up
> >> with a sane virtualization model of this functionality. Simply
> >> exposing the CPUID bits is not going to be an option.
> >
> > Is it due to any security risks? If so, are there any advisories around it?
>
> No, it's because of the split of responsibilities: It's Xen to manage
> the CPUs.
>
> > Should it be allowed that Xen is hiding CPU flags (in this case
> > Therm), yet a modification to Dom0 kernel allows them to be brought
> > back?
>
> Yes, a PV kernel is supposed to do things the PV way, i.e. in
> particular use the PV form of CPUID. (Note that on hardware supporting
> CPUID faulting you can't "bring back" the flags via a kernel change,
> since then _all_ CPUID invocations will be handled by Xen instead of
> by bare hardware. So _not_ doing things the PV way in the kernel sets
> you up for surprises.)
>
> Jan

ok, thanks for clearing it up. Would a patch be accepted if this
option of showing EAX leaf is selectively done through command line
(default disabled)?
On longer run, what is an expected sane model of virtualizing this?
With some guidance, may be I or someone else can code to bring the
functionality back.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-11-19  5:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 16:07 [Xen-devel] Xen hiding thermal capabilities from Dom0 Rishi
2019-11-14 16:35 ` Jan Beulich
2019-11-15 19:19   ` Rishi
2019-11-18  9:38     ` Jan Beulich
2019-11-19  5:23       ` Rishi [this message]
2019-11-19  9:17         ` Jan Beulich
2019-11-21 13:39           ` Rishi
2019-11-21 13:56             ` Roger Pau Monné
2019-11-21 15:26               ` Rishi
2019-11-21 15:45                 ` Roger Pau Monné
2019-11-21 15:52                   ` Jan Beulich
2019-11-21 15:45                 ` Jan Beulich
2019-11-21 14:24             ` Jürgen Groß
2019-11-21 15:31               ` Rishi
2019-11-21 15:36               ` Jan Beulich
2019-11-21 15:46                 ` Jürgen Groß
2019-11-21 15:47                   ` Jan Beulich
2019-11-23  4:29                   ` Elliott Mitchell
2019-11-25  8:25                     ` Jürgen Groß
2019-11-25 15:43                       ` Rishi
2019-11-25 15:54                         ` Jan Beulich
2019-11-21 15:40             ` Jan Beulich

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=CAO9XypVNhSd8hPu1nA1uP8PVCPVgW-Bs_q6gmPky6Px0-U6G+w@mail.gmail.com \
    --to=2rushikeshj@gmail.com \
    --cc=jbeulich@suse.com \
    --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.