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/
Home Products Support Community News


[Xen-devel] Re: Questions about current panic/BUG_ON/BUG usage in XEN

To: "Ke, Liping" <liping.ke@xxxxxxxxx>
Subject: [Xen-devel] Re: Questions about current panic/BUG_ON/BUG usage in XEN
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Mon, 22 Sep 2008 09:57:45 +0100
Cc: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 22 Sep 2008 01:58:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E2263E4A5B2284449EEBD0AAB751098401ABCF3AB7@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: AckciV7D4rVqjFbrTNqm3DVZcV86PQAB+ibF
Thread-topic: Questions about current panic/BUG_ON/BUG usage in XEN
User-agent: Microsoft-Entourage/
On 22/9/08 09:01, "Ke, Liping" <liping.ke@xxxxxxxxx> wrote:

> 1) Lots of parameter's checking using BUG_ON where it would be nicer if we use
> ASSERT instead?

I tend to use ASSERT() where I think the error condition is *really*
unlikely or could incur an unwanted overhead on non-debug builds. I don't
use it where I have an inkling that a BUG_ON() might fire when I don't want
it to.

> 2) Some errors which only impact a device/domain cause whole machine panic
> such as
> I8254.c (c:\upstream\xen\xen\arch\x86\hvm):    BUG_ON(bytes != 1);
> Hvm.c (c:\upstream\xen\xen\arch\x86\hvm):    BUG_ON(bytes != 1);

Both valid because they are handlers for a single I/O port, and code in
intercept.c will prevent multi-byte I/O port accesses from reaching the

> Just want to know whether we need to do some clean up jobs and made some panic
> criteria?

No, if you are seeing BUG_ON()s firing then we only remove the BUG_ON() or
panic() if its assumptions are invalid. Also panic/BUG_ON is not great if we
are relying on correct BIOS tables or timely operation of asynchronous
hardware (I'm thinking programming of VT-d engines, for example).
Assertion/BUG_ON/panic about self-consistency of the hypervisor itself
should absolutely stay as they are.

 -- Keir

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Re: Questions about current panic/BUG_ON/BUG usage in XEN, Keir Fraser <=