All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	Tim Deegan <tim@xen.org>, Keir Fraser <keir@xen.org>,
	Jan Beulich <JBeulich@suse.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/2] xen: Identify panic and reboot/halt functions as noreturn
Date: Mon, 25 Nov 2013 10:37:36 +0000	[thread overview]
Message-ID: <52932870.9090200@citrix.com> (raw)
In-Reply-To: <1385375679.22002.13.camel@kazak.uk.xensource.com>

On 25/11/13 10:34, Ian Campbell wrote:
> On Mon, 2013-11-25 at 10:25 +0000, Andrew Cooper wrote:
>> On an x86 build (GCC Debian 4.7.2-5), this reduces the .text size by exactly
>> 4K, and .init.text by 1751 bytes.
>>
>> Even in a non-debug build, the generated code uses `call` rather than `jmp` so
>> there should be no impact on any stack trace generation.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Ian Campbell <ian.campbell@citrix.com>
>> CC: Stefano Stabellini <stefano.stabellini@citrix.com>
>> CC: Tim Deegan <tim@xen.org>
>>
>> ---
>>
>> I believe I have identified each reasonable ARM function which could be tagged
>> as noreturn, but am not overly familiar with the codebase.
>>
>> I have compile tested arm32 and arm64
>> ---
>>  xen/arch/arm/shutdown.c       |    6 +++---
>>  xen/arch/arm/smpboot.c        |    2 +-
>>  xen/arch/x86/cpu/mcheck/mce.c |    2 +-
>>  xen/arch/x86/cpu/mcheck/mce.h |    2 +-
>>  xen/arch/x86/shutdown.c       |    6 +++---
>>  xen/common/shutdown.c         |    4 ++--
>>  xen/drivers/char/console.c    |    2 +-
>>  xen/include/asm-arm/smp.h     |    2 +-
>>  xen/include/xen/lib.h         |    2 +-
>>  xen/include/xen/shutdown.h    |   10 ++++++----
>>  10 files changed, 20 insertions(+), 18 deletions(-)
>>
>> diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
>> index 767cc12..58f1cf1 100644
>> --- a/xen/arch/arm/shutdown.c
>> +++ b/xen/arch/arm/shutdown.c
>> @@ -11,12 +11,12 @@ static void raw_machine_reset(void)
>>      platform_reset();
>>  }
>>  
>> -static void halt_this_cpu(void *arg)
>> +static void noreturn halt_this_cpu(void *arg)
>>  {
>>      stop_cpu();
> You also tag stop_cpu, are both necessary? Especially for a static
> function.
>
>>  }
>>  
>> -void machine_halt(void)
>> +void noreturn machine_halt(void)
> And you also tag halt_this_cpu which machine_halt ends with.

Based on my experience getting x86 to compile with panic alone as
noreturn, yes.

machine_halt() certainly as I changed the common function declaration.

~Andrew

>
>>  {
>>      watchdog_disable();
>>      console_start_sync();
>> @@ -25,7 +25,7 @@ void machine_halt(void)
>>      halt_this_cpu(NULL);
>>  }
>>  
>> -void machine_restart(unsigned int delay_millisecs)
>> +void noreturn machine_restart(unsigned int delay_millisecs)
>>  {
>>      int timeout = 10;
>>  
>> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
>> index 6c90fa6..7242331 100644
>> --- a/xen/arch/arm/smpboot.c
>> +++ b/xen/arch/arm/smpboot.c
>> @@ -310,7 +310,7 @@ void __cpu_disable(void)
>>       * scheduler will drop to the idle loop, which will call stop_cpu(). */
>>  }
>>  
>> -void stop_cpu(void)
>> +void noreturn stop_cpu(void)
>>  {
>>      local_irq_disable();
>>      cpu_is_dead = 1;
>

  reply	other threads:[~2013-11-25 10:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 10:25 [PATCH 0/2] Improvements with noreturn Andrew Cooper
2013-11-25 10:25 ` [PATCH 1/2] xen/compiler: Replace opencoded __attribute__((noreturn)) Andrew Cooper
2013-11-25 10:31   ` Ian Campbell
2013-11-25 10:45   ` Tim Deegan
2013-11-25 10:57   ` Jan Beulich
2013-11-25 10:25 ` [PATCH 2/2] xen: Identify panic and reboot/halt functions as noreturn Andrew Cooper
2013-11-25 10:34   ` Ian Campbell
2013-11-25 10:37     ` Andrew Cooper [this message]
2013-11-25 10:45   ` Tim Deegan
2013-11-25 11:47 ` [PATCH 0/2] Improvements with noreturn George Dunlap
2013-11-25 14:02   ` Andrew Cooper
2013-11-25 14:46     ` George Dunlap
2013-11-25 14:50       ` Andrew Cooper

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=52932870.9090200@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@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 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.