WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3 of 4] xentrace: reduce size of extradata in tra

To: Olaf Hering <olaf@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3 of 4] xentrace: reduce size of extradata in trace_irq_mask()
From: Keir Fraser <keir@xxxxxxx>
Date: Sat, 16 Jul 2011 09:25:18 +0100
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Delivery-date: Sat, 16 Jul 2011 01:26:07 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=9bMmIF78CKrieXhQQnel2+fHQe2QKPHJqWZrJrx6Nkw=; b=nHldzqhS0ManHE5unDzYrysjS7WO2K5p/j9r5qZ3ysNa84TSQfKXg97PojHEViFDIW jOsuIwmClbAZ37LYlZ7Qp/4BEqFCTZTM23XPOUlq9pW1gAnO1rFNavvKenCsUF3EnJWO 8yZuSWqa0P6TbLULOVk//pRpwCjlUpMSYniiQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <6e4aef7b5051e18f19f2.1310744287@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcxDkeUbTG5oVuXrw0eRt3ObNnKSNQ==
Thread-topic: [Xen-devel] [PATCH 3 of 4] xentrace: reduce size of extradata in trace_irq_mask()
User-agent: Microsoft-Entourage/12.29.0.110113
On 15/07/2011 16:38, "Olaf Hering" <olaf@xxxxxxxxx> wrote:

> # HG changeset patch
> # User Olaf Hering <olaf@xxxxxxxxx>
> # 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.

Ah, so the assertion did its job. :-)

 -- Keir

> (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@xxxxxxxxx>
> 
> 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)
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>