From: Tim Deegan <tim@xen.org>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] arm: use a per-VCPU stack
Date: Sat, 18 Feb 2012 13:52:44 +0000 [thread overview]
Message-ID: <20120218135244.GA1531@ocelot.phlegethon.org> (raw)
In-Reply-To: <1329324592-12589-1-git-send-email-ian.campbell@citrix.com>
At 16:49 +0000 on 15 Feb (1329324592), Ian Campbell wrote:
> +struct pcpu_info {
> + unsigned int processor_id;
> + struct vcpu *current_vcpu;
> +};
> +
> +DECLARE_PER_CPU(struct pcpu_info, pcpu_info);
> +static inline struct pcpu_info *get_pcpu_info(void)
> +{
> + return &this_cpu(pcpu_info);
> +}
> +
I don't think it's worth declaring a struct and accessors for this; we
should just have current_vcpu as an ordinary per-cpu variable.
Storing the CPU ID in the per-pcpu area only happens to work because
per-cpu areas are a noop right now. I have a patch that re-enables them
properly but for that we'll need a proper way of getting the CPU id. In
the meantime I think it would be less confusing just to hard-code it as
zero than to do this. :)
We could use the physical CPU ID register; I don't know whether it would
be faster to stash the ID on the (per-vcpu) stack and update it during
context switch.
Aside from that, this patch looks OK to me.
Cheers,
Tim.
next prev parent reply other threads:[~2012-02-18 13:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 16:49 [PATCH] arm: use a per-VCPU stack Ian Campbell
2012-02-18 13:52 ` Tim Deegan [this message]
2012-02-19 8:44 ` Ian Campbell
2012-02-19 9:31 ` Tim Deegan
2012-02-20 14:43 ` [PATCH v2] " Ian Campbell
2012-02-20 14:58 ` Tim Deegan
2012-02-22 14:33 ` Ian Campbell
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=20120218135244.GA1531@ocelot.phlegethon.org \
--to=tim@xen.org \
--cc=ian.campbell@citrix.com \
--cc=xen-devel@lists.xensource.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).