From: David Gibson <david@gibson.dropbear.id.au>
To: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: stewart@linux.vnet.ibm.com, benh@au1.ibm.com, aik@ozlabs.ru,
agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
paulus@au1.ibm.com,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)
Date: Thu, 12 Nov 2015 15:47:15 +1100 [thread overview]
Message-ID: <20151112044715.GB4886@voom.redhat.com> (raw)
In-Reply-To: <20151111221048.GF4644@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 5209 bytes --]
On Wed, Nov 11, 2015 at 02:10:48PM -0800, Nishanth Aravamudan wrote:
> On 11.11.2015 [12:41:26 +1100], David Gibson wrote:
> > On Tue, Nov 10, 2015 at 04:56:38PM -0800, Nishanth Aravamudan wrote:
> > > On 11.11.2015 [11:17:58 +1100], David Gibson wrote:
> > > > On Mon, Nov 09, 2015 at 08:22:32PM -0800, Sukadev Bhattiprolu wrote:
>
> <snip>
>
> > > > The trouble with xscom is that it's extremely specific to the way the
> > > > current IBM servers present things. It won't work on other types of
> > > > host machine (which could happen with PR KVM), and could even break if
> > > > IBM changes the way it organizes the SCOMs in a future machine.
> > > >
> > > > Working from the nodes in /cpus still has some dependencies on IBM
> > > > specific properties, but it's at least partially based on OF
> > > > standards.
> > > >
> > > > There's also another possible approach here, though I don't know if it
> > > > will work. Instead of looking directly in the device tree, try to get
> > > > the information from lscpu, or libosinfo. That would at least give
> > > > you some hope of providing meaningful information on other host types.
> > >
> > > Heh, the issue that is underlying all of this, is that `lscpu` itself is
> > > quite wrong.
> > >
> > > On PAPR-compliant hypervisors (well, PowerVM, at least), the only
> > > supported means of determining the underlying hardware CPU information
> > > (which is what licensing models want in the end), is to use this RTAS
> > > call in an LPAR. `lscpu` is explicitly incorrect in these environments
> > > (it's values are "derived" from sysfs and some are adjusted to ensure
> > > the division of values works out).
> >
> > So.. I'm not sure if you're just saying that lscpu is wrong because it
> > gives the guest information, or because of other problems.
>
> `lscpu`'s man-page specifically says that on virtualized platforms, the
> output may be inaccurate. And, in fact, on Power, in a KVM guest (and
> in a LPAR), `lscpu` is outputting the guest CPU information, which is
> completely fake. This is true on x86 KVM guests too, afaict.
Um.. yes, I was assuming lscpu reporting information about virtual
cpus and sockets was intended and correct behaviour.
> *If* we have a valid RTAS implementation on PowerKVM (or under qemu
> generally), I think we can modify `lscpu` to do the right thing in at
> least those two environments.
>
> > What I was suggesting is implementing the RTAS call so that it
> > effectively lets the guest get lscpu information from the host.
>
> A bit of a chicken & egg problem, I'd say. The `lscpu` output in PowerNV
> is also wrong :)
Ok.. why is it wrong in PowerNV? This sounds like something you'd
want to fix anyway.
> > > So, we are trying to at least resolve what PowerKVM guest can see by
> > > supporting this RTAS call there. We should report *something* to the
> > > guest, if possible, and we can adjust what is reported to the guests as
> > > we go, from the host perspective.
> > >
> > > I haven't followed along too closely in this thread, but woudl it be
> > > reasonable to only report this RTAS call as being supported under
> > > KVM?
> >
> > Possibly, yes.
>
> At least, as a first step, I guess.
>
> > > How are other RTAS calls dealt with for PR and non-IBM models
> > > currently?
> >
> > Most of them still make sense in PR or TCG. A few do look in the host
> > device tree, in which case they're likely to fail on non-KVM.
>
> Got it, thanks.
>
> So my investigation overall led me to this set of conclusions:
>
> 1) Under PowerVM, we do not use this RTAS call, which is the only (as
> asserted by pHyp developers) valid way to get hardware information about
> the machine. Therefore, the PowerVM `lscpu` output is the "virtual" CPU
> information -- where cores are as defined by sharing of the L2-cache.
>
> 2) Under PowerKVM, we do not use this RTAS call, because it's not
> supported, and just spit out whatever the qemu topology is (which has no
> connection to the host (physical) CPU information).
Right.. so does that mean nothing is using this call yet?
> --> so if we implement the RTAS call of some sort under PowerKVM, then
> we can update `lscpu` to use that RTAS call.
Yeah, I'm not convinced that's correct. Shouldn't lscpu return the
virtual cpu information, at least by default.
> 3) Under PowerNV, there is a dependency on the hack that is ibm,chip-id
> from OPAL, which leads to twice as many sockets potentially being
> reported. `lscpu` also uses the sysfs files directly, which may or may
> not be the physical topology (I'm still tracking all of this down).
>
> *Also* `lscpu` has no knowledge of offline/online CPUs, so as you
> online/offline CPUs, the output of `lscpu` starts to change.
Ah, true.
> I think what we eventually want to do is add some fields to `lscpu` to
> indicate the "physical" data vs. the "virtual" data.
Ok.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-11-12 4:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 23:06 [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO) Sukadev Bhattiprolu
2015-11-09 1:57 ` Alexey Kardashevskiy
2015-11-09 5:01 ` David Gibson
2015-11-10 3:57 ` Sukadev Bhattiprolu
2015-11-10 4:25 ` Alexey Kardashevskiy
2015-11-10 4:46 ` Sukadev Bhattiprolu
2015-11-10 6:58 ` Alexey Kardashevskiy
2015-11-10 18:27 ` Sukadev Bhattiprolu
2015-11-09 4:58 ` David Gibson
2015-11-10 4:22 ` Sukadev Bhattiprolu
2015-11-10 9:53 ` Thomas Huth
2015-11-13 20:29 ` Sukadev Bhattiprolu
2015-11-11 0:17 ` David Gibson
2015-11-11 0:56 ` Nishanth Aravamudan
2015-11-11 1:41 ` David Gibson
2015-11-11 22:10 ` Nishanth Aravamudan
2015-11-12 4:47 ` David Gibson [this message]
2015-11-12 16:46 ` Nishanth Aravamudan
2015-12-01 3:41 ` David Gibson
2015-12-05 1:04 ` Nishanth Aravamudan
2015-12-10 3:55 ` David Gibson
2015-11-13 20:21 ` Sukadev Bhattiprolu
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=20151112044715.GB4886@voom.redhat.com \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=benh@au1.ibm.com \
--cc=nacc@linux.vnet.ibm.com \
--cc=paulus@au1.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=stewart@linux.vnet.ibm.com \
--cc=sukadev@linux.vnet.ibm.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 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).