qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
	David Gibson <david@gibson.dropbear.id.au>
Cc: stewart@linux.vnet.ibm.com, benh@au1.ibm.com, aik@ozlabs.ru,
	nacc@linux.vnet.ibm.com, agraf@suse.de, qemu-devel@nongnu.org,
	qemu-ppc@nongnu.org, paulus@au1.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)
Date: Tue, 10 Nov 2015 10:53:58 +0100	[thread overview]
Message-ID: <5641BEB6.3020902@redhat.com> (raw)
In-Reply-To: <20151110042232.GB20030@us.ibm.com>

On 10/11/15 05:22, Sukadev Bhattiprolu wrote:
[...]
> | > +static int file_read_buf(char *file_name, char *buf, int len)
> | > +{
> | > +    int rc;
> | > +    FILE *fp;
> | > +
> | > +    fp = fopen(file_name, "r");
> | > +    if (!fp) {
> | > +        error_report("%s: Error opening %s\n", __func__, file_name);
> | > +        return -1;
> | > +    }
> | > +
> | > +    rc = fread(buf, 1, len, fp);
> | > +    fclose(fp);
> | > +
> | > +    if (rc != len) {
> | > +        return -1;
> | > +    }
> | > +
> | > +    return 0;
> | > +}

Could you maybe use g_file_get_contents() instead?

> | > +/*
> | > + * Each core in the system is represented by a directory with the
> | > + * prefix 'PowerPC,POWER' in the directory /proc/device-tree/cpus/.
> | > + * Process that directory and count the number of cores in the system.
> | 
> | True on IBM POWER systems, but not necessarily everywhere - e.g. PR
> | KVM on an embedded PowerPC host.
> 
> What is PR KVM?

On PPC, there are multiple kinds of KVM kernel modules, e.g. KVM-HV and
KVM-PR (and further implementations for embedded PPCs, too). KVM-HV is
using the hypervisor hardware feature of the current POWER7 and POWER8
chips, while KVM-PR is using the PRoblem state to emulate a virtual
machine. KVM-PR thus also works on older PPC hardware.
So there are multiple PPC environments where QEMU can run on, and you
must not assume that you always have nodes like "PowerPC,POWER" in the
device tree.
(BTW, you can also build kernels without the /proc/device-tree file
system as far as I know ... so you never should fully rely on that
without a fallback strategy)

 Thomas

  reply	other threads:[~2015-11-10  9:54 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 [this message]
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
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=5641BEB6.3020902@redhat.com \
    --to=thuth@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=benh@au1.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --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).