From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] Re: [PATCH 1/3] pseries: Abolish envs array
Date: Tue, 05 Apr 2011 15:55:22 +0200 [thread overview]
Message-ID: <4D9B1F4A.9030204@suse.de> (raw)
In-Reply-To: <20110405131659.GA21368@yookeroo>
On 04/05/2011 03:16 PM, David Gibson wrote:
> On Tue, Apr 05, 2011 at 10:05:12AM +0200, Alexander Graf wrote:
>> On 05.04.2011, at 07:12, David Gibson wrote:
> [snip]
>>> +struct icp_state *xics_system_init(int nr_irqs)
>>> {
>>> + CPUState *env;
>>> + int max_server_num;
>>> int i;
>>> struct icp_state *icp;
>>> struct ics_state *ics;
>>>
>>> + max_server_num = -1;
>>> + for (env = first_cpu; env != NULL; env = env->next_cpu) {
>>> + if (env->cpu_index> max_server_num) {
>>> + max_server_num = env->cpu_index;
>>> + }
>>> + }
>>> +
>>> icp = qemu_mallocz(sizeof(*icp));
>>> - icp->nr_servers = nr_servers;
>>> - icp->ss = qemu_mallocz(nr_servers * sizeof(struct icp_server_state));
>>> + icp->nr_servers = max_server_num + 1;
>>> + icp->ss = qemu_mallocz(icp->nr_servers*sizeof(struct icp_server_state));
>>> +
>>> + for (i = 0; i< icp->nr_servers; i++) {
>>> + icp->ss[i].mfrr = 0xff;
>> Is ss always big enough to hold all CPUs + 1?
> Well, it should be. We allocated it just above based on
> icp->nr_servers, and nr_servers is the largest cpu_index + 1, computer
> just above that
Ah, there it is :). I missed that part. Will apply the patches to my tree.
Alex
next prev parent reply other threads:[~2011-04-05 13:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 5:12 [Qemu-devel] [0/3] pSeries machine improvements David Gibson
2011-04-05 5:12 ` [Qemu-devel] [PATCH 1/3] pseries: Abolish envs array David Gibson
2011-04-05 8:05 ` [Qemu-devel] " Alexander Graf
2011-04-05 13:16 ` David Gibson
2011-04-05 13:55 ` Alexander Graf [this message]
2011-04-05 5:12 ` [Qemu-devel] [PATCH 2/3] Delay creation of pseries device tree until reset David Gibson
2011-04-05 5:12 ` [Qemu-devel] [PATCH 3/3] Use existing helper function to implement popcntd instruction David Gibson
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=4D9B1F4A.9030204@suse.de \
--to=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.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.