From: George Dunlap <george.dunlap@citrix.com>
To: Keir Fraser <keir@xen.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
Olaf Hering <olaf@aepfle.de>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Re: [PATCH 2 of 4] xentrace: replace ASSERT with printk in __trace_var
Date: Mon, 18 Jul 2011 11:41:57 +0100 [thread overview]
Message-ID: <1310985717.3401.11.camel@elijah> (raw)
In-Reply-To: <CA470876.2F8DA%keir@xen.org>
On Sat, 2011-07-16 at 09:20 +0100, Keir Fraser wrote:
> It's not like we have dodgy third-party drivers to worry about. Just fix the
> code -- *which is in the tree!* -- that is making the bad calls! It was
> correct to make this an assert/bug_on in the first place.
I think Olaf was objecting to a relatively minor fault like this causing
a hypervisor crash (in debug builds only of course), and asked if it
could be changed to a warning instead.
My personal preference would be to keep it an ASSERT, but I'm not really
that fussed either way. The main thing is to make sure that only debug
builds may have significant negative effects, and I think this patch
doesn't satisfy that (as if you add loglvl=all on a production system,
you may get stuck sending significant output to the console).
-George
>
> -- Keir
>
> On 15/07/2011 17:31, "George Dunlap" <george.dunlap@citrix.com> wrote:
>
> > This seems likely to spam the console if there is a trace which violates
> > this; and this may happen in production environments if the loglevel is
> > increased. I think putting in something to warn just once would be a
> > better idea.
> >
> > -George
> >
> > On Fri, 2011-07-15 at 16:38 +0100, Olaf Hering wrote:
> >> # HG changeset patch
> >> # User Olaf Hering <olaf@aepfle.de>
> >> # Date 1310741871 -7200
> >> # Node ID e0ff4eea0432e0af3210e090a47414a0126e9904
> >> # Parent d0dcdddf5285eba0605a95dfda79b794803fa733
> >> xentrace: replace ASSERT with printk in __trace_var
> >>
> >> If trace_var gets called with large extra_data, do not crash the hypervisor.
> >> Instead print a warning and truncate the buffer.
> >>
> >> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> >>
> >> diff -r d0dcdddf5285 -r e0ff4eea0432 xen/common/trace.c
> >> --- a/xen/common/trace.c
> >> +++ b/xen/common/trace.c
> >> @@ -683,7 +683,10 @@ void __trace_var(u32 event, bool_t cycle
> >> if ( (extra % sizeof(u32)) != 0 )
> >> extra_word++;
> >>
> >> - ASSERT(extra_word <= TRACE_EXTRA_MAX);
> >> + if ( unlikely(extra_word > TRACE_EXTRA_MAX) )
> >> + printk(XENLOG_WARNING "xentrace: event %x extra_data %u too
> >> large.\n",
> >> + event, extra);
> >> +
> >> extra_word = min_t(int, extra_word, TRACE_EXTRA_MAX);
> >>
> >> /* Round size up to nearest word */
> >
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
>
>
next prev parent reply other threads:[~2011-07-18 10:41 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 [this message]
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
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=1310985717.3401.11.camel@elijah \
--to=george.dunlap@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=keir@xen.org \
--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.