All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 3 of 4] xentrace: reduce size of extradata in trace_irq_mask()
Date: Fri, 15 Jul 2011 17:28:03 +0100	[thread overview]
Message-ID: <1310747283.448.90.camel@elijah> (raw)
In-Reply-To: <6e4aef7b5051e18f19f2.1310744287@probook.site>

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

On Fri, 2011-07-15 at 16:38 +0100, Olaf Hering wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # Date 1310743144 -7200
> # Node ID 6e4aef7b5051e18f19f2367a4439bba8f495335c
> # Parent  e0ff4eea0432e0af3210e090a47414a0126e9904
> xentrace: reduce size of extradata in trace_irq_mask()
> 
> Reduce size of extra_data in to avoid possible crash in trace_var.
> 
> (XEN) Assertion 'extra_word <= TRACE_EXTRA_MAX' failed at trace.c:687
> (XEN) Xen call trace:
> (XEN)    [<ffff82c480128783>] __trace_var+0x4d/0x3b8
> (XEN)    [<ffff82c480162172>] trace_irq_mask+0x49/0x4b
> (XEN)    [<ffff82c4801631ae>] __assign_irq_vector+0x241/0x374
> (XEN)    [<ffff82c48015d813>] set_desc_affinity+0x5d/0xd4
> (XEN)    [<ffff82c480160708>] set_msi_affinity+0x44/0x1c1
> (XEN)    [<ffff82c480162938>] move_masked_irq+0x9c/0xcd
> (XEN)    [<ffff82c4801629a7>] move_native_irq+0x3e/0x53
> (XEN)    [<ffff82c48015d969>] ack_msi_irq+0x2c/0x6e
> (XEN)    [<ffff82c4801622e3>] do_IRQ+0x16f/0x66d
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> diff -r e0ff4eea0432 -r 6e4aef7b5051 xen/arch/x86/irq.c
> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -77,10 +77,14 @@ void unlock_vector_lock(void)
>  static void trace_irq_mask(u32 event, int irq, int vector, cpumask_t *mask)
>  {
>      struct {
> -        int irq, vec;
> -        cpumask_t mask;
> -    } d = { irq, vector, *mask };
> -    trace_var(event, 1, sizeof(d), (unsigned char *)&d);
> +        unsigned int irq:16, vec:16;
> +        unsigned int mask[6];
> +    } d;
> +    d.irq = irq;
> +    d.vec = vector;
> +    memset(d.mask, 0, sizeof(d.mask));
> +    memcpy(d.mask, mask, min(sizeof(d.mask), sizeof(cpumask_t)));
> +    trace_var(event, 1, sizeof(d), &d);
>  }
>  
>  static int __init __bind_irq_vector(int irq, int vector, cpumask_t cpu_mask)

  reply	other threads:[~2011-07-15 16:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 15:38 [PATCH 0 of 4] xentrace fixes for xen-unstable Olaf Hering
2011-07-15 15:38 ` [PATCH 1 of 4] hvm: remove cast from trace_var call for HVMOP_xentrace Olaf Hering
2011-07-15 15:48   ` George Dunlap
2011-07-15 15:38 ` [PATCH 2 of 4] xentrace: replace ASSERT with printk in __trace_var Olaf Hering
2011-07-15 16:31   ` George Dunlap
2011-07-16  8:20     ` Keir Fraser
2011-07-18  9:04       ` Olaf Hering
2011-07-18  9:37         ` Keir Fraser
2011-07-18 10:41       ` George Dunlap
2011-07-18 11:12         ` Keir Fraser
2011-07-15 15:38 ` [PATCH 3 of 4] xentrace: reduce size of extradata in trace_irq_mask() Olaf Hering
2011-07-15 16:28   ` George Dunlap [this message]
2011-07-16  8:25   ` Keir Fraser
2011-07-15 15:38 ` [PATCH 4 of 4] Add a trace hypercall to allow tracing from dom0 or domU Olaf Hering
2011-07-15 16:49   ` George Dunlap
2011-07-15 20:45     ` Olaf Hering
2011-07-18  8:56   ` Tim Deegan
2011-07-18 11:17     ` George Dunlap
2011-07-18 12:22       ` Tim Deegan

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=1310747283.448.90.camel@elijah \
    --to=george.dunlap@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=olaf@aepfle.de \
    --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 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.