[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/x86: Be more power-efficient when waiting forever
On 02/12/13 15:03, Jan Beulich wrote: >>>> On 02.12.13 at 15:38, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote: >> There is one final for(;;); loop, but is in common code and immediately >> following a call to panic(), so is actually dead code and will be cleaned up >> in v2 of my "noreturn" series at the start of 4.5 > In the context of this, this one ... > >> --- a/xen/arch/x86/efi/boot.c >> +++ b/xen/arch/x86/efi/boot.c >> @@ -201,7 +201,8 @@ static void __init __attribute__((__noreturn__)) >> blexit(const CHAR16 *str) >> efi_bs->FreePages(xsm.addr, PFN_UP(xsm.size)); >> >> efi_bs->Exit(efi_ih, EFI_SUCCESS, 0, NULL); >> - for( ; ; ); /* not reached */ >> + for ( ; ; ) /* not reached */ >> + halt(); > ... seems pointless (but of course also not wrong). I suppose - I guess all that is needed here is for the compiler to find no way to the end of this function. I wonder whether an "unreachable()" would suffice? In the optimal case, the compiler should not emit any instructions for it. ~Andrew > >> --- a/xen/arch/x86/traps.c >> +++ b/xen/arch/x86/traps.c >> @@ -1448,7 +1448,8 @@ void __init do_early_page_fault(struct cpu_user_regs >> *regs) >> printk("Stack dump: "); >> while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != >> 0 ) >> printk("%p ", _p(*stk++)); >> - for ( ; ; ) ; >> + for ( ; ; ) >> + halt(); > While clearly this one is desirable. > > Jan > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |