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

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

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] RE: Questions about current panic/BUG_ON/BUG usage in XEN
From: "Ke, Liping" <liping.ke@xxxxxxxxx>
Date: Mon, 6 Oct 2008 10:35:20 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sun, 05 Oct 2008 19:35:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C4FD1C99.273A9%keir.fraser@xxxxxxxxxxxxx>
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>
References: <E2263E4A5B2284449EEBD0AAB751098401ABCF3AB7@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C4FD1C99.273A9%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AckciV7D4rVqjFbrTNqm3DVZcV86PQAB+ibFArKOVaA=
Thread-topic: Questions about current panic/BUG_ON/BUG usage in XEN
Keir Fraser wrote:
> 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 handler.
>

Hi, Keir
Here you mean that this BUG_ON would never happen?
So would it be better to remove such BUG_ON or replace them with ASSERT?

Another example is
Intercept.c (c:\upstream\xen\xen\arch\x86\hvm):    BUG_ON(num >= 
MAX_IO_HANDLER);

I remember I meet the error when do HVM Sx test. When register same handler 
repeatedly several times,
this bug will be triggered. So just want to know the criteria here: Even if it 
is not good to register repeatedly,
must we panic the whole machine? After all, it is only an error contained in a 
hvm domain, is it?

Thanks a lot for your help -:)
Regards,
Criping

>> 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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

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