From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Keir Fraser <keir@xen.org>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] xen/x86: Be more power-efficient when waiting forever
Date: Mon, 2 Dec 2013 15:06:40 +0000 [thread overview]
Message-ID: <529CA200.5030207@citrix.com> (raw)
In-Reply-To: <529CAF5A0200007800108D1A@nat28.tlf.novell.com>
On 02/12/13 15:03, Jan Beulich wrote:
>>>> On 02.12.13 at 15:38, Andrew Cooper <andrew.cooper3@citrix.com> 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
>
next prev parent reply other threads:[~2013-12-02 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 14:38 [PATCH] xen/x86: Be more power-efficient when waiting forever Andrew Cooper
2013-12-02 15:03 ` Jan Beulich
2013-12-02 15:06 ` Andrew Cooper [this message]
2013-12-02 15:23 ` Keir Fraser
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=529CA200.5030207@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).