xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	George Dunlap <George.Dunlap@citrix.com>
Subject: Re: [PATCH v3 1/3] libxl/cpumap: Add xc_cpumap_[setcpu, clearcpu, testcpu] to complement xc_cpumap_alloc.
Date: Wed, 25 Mar 2015 11:01:19 +0000	[thread overview]
Message-ID: <1427281279.10784.61.camel@citrix.com> (raw)
In-Reply-To: <1427273263.2560.227.camel@citrix.com>

On Wed, 2015-03-25 at 08:47 +0000, Dario Faggioli wrote:
> On Tue, 2015-03-24 at 17:46 +0000, Ian Campbell wrote:
> > On Tue, 2015-03-24 at 11:39 -0400, Konrad Rzeszutek Wilk wrote:
> 
> > > +void xc_cpumap_clearcpu(int cpu, xc_cpumap_t map)
> > > +{
> > > +    clear_bit(cpu, (unsigned long *)map);
> > 
> > Is it necessary to worry about alignment here, since xc_cpumap_t is
> > actually a uint8_t*.
> >
> > [..]
> >
> > Or do we rely on all of these always being dynamically allocated (via
> > xc_cpumap_alloc) and therefore "suitably aligned so that it may be
> > assigned to a pointer to any type of object"[0]  following calloc ,
> > avoids the issue in practice?
> > 
> > I think we probably do, does anyone disagree with that assessment?
> > 
> FWIW, I agree with it.
> 
> The only use case that deviates from that which I could find is:
> 
> xc_vcpu_setaffinity()
>   |
>   --> xc_hypercall_bounce_pre() ==
>       xc__hypercall_bounce_pre()
>         |
>         --> xc__hypercall_buffer_alloc()
>               |
>               --> xc__hypercall_buffer_alloc_pages()
>                     |
>                     --> hypercall_buffer_cache_alloc() ||
>                         linux_privcmd_alloc_hypercall_buffer() (or OS speific variants)
> 
> which is probably still fine, isn't it?

Might we use test_bit and friends on a hypercall buffer directly? I
didn't expect so.

I think it would be safe none the less, since it is all page aligned,
but someone would need to check I didn't do something smarter for small
allocations at some point..

> 
> Regards,
> Dario

  reply	other threads:[~2015-03-25 11:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 15:39 [PATCH v3] Support CPU-list parsing in xentrace Konrad Rzeszutek Wilk
2015-03-24 15:39 ` [PATCH v3 1/3] libxl/cpumap: Add xc_cpumap_[setcpu, clearcpu, testcpu] to complement xc_cpumap_alloc Konrad Rzeszutek Wilk
2015-03-24 17:46   ` Ian Campbell
2015-03-24 20:29     ` Konrad Rzeszutek Wilk
2015-03-25  8:53       ` Dario Faggioli
2015-03-25 17:16         ` Konrad Rzeszutek Wilk
2015-03-25  8:47     ` Dario Faggioli
2015-03-25 11:01       ` Ian Campbell [this message]
2015-03-25 11:16         ` Dario Faggioli
2015-03-24 15:39 ` [PATCH v3 2/3] libxc/xentrace: Replace xc_tbuf_set_cpu_mask with CPU mask with xc_cpumap_t instead of uint32_t Konrad Rzeszutek Wilk
2015-03-30 16:10   ` George Dunlap
2015-03-30 16:54     ` Konrad Rzeszutek Wilk
2015-03-30 17:33       ` George Dunlap
2015-03-30 18:04         ` Konrad Rzeszutek Wilk
2015-03-31 10:41           ` George Dunlap
2015-03-24 15:39 ` [PATCH v3 3/3] xentrace: Implement cpu mask range parsing of human values (-c) Konrad Rzeszutek Wilk
2015-03-31 11:31   ` George Dunlap
2015-04-03 19:34     ` Konrad Rzeszutek Wilk
2015-05-07 16:07       ` George Dunlap
2015-05-15 20:17         ` Konrad Rzeszutek Wilk

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=1427281279.10784.61.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=xen-devel@lists.xenproject.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 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).