From 5c1d5f283a855a5fe6b4f122054d85072b97ae4a Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Thu, 21 Jan 2016 16:49:31 -0600 Subject: watchdog/hpwdt: Create stack frame in asminline_call() asminline_call() is a callable non-leaf function which doesn't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Create a stack frame when CONFIG_FRAME_POINTER is enabled. Signed-off-by: Josh Poimboeuf Cc: Andrew Morton Cc: Andy Lutomirski Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Brian Gerst Cc: Chris J Arges Cc: Denys Vlasenko Cc: Guenter Roeck Cc: H. Peter Anvin Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/60de3cfb6f16d413bfb923036cc87fec132df735.1453405861.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- drivers/watchdog/hpwdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/watchdog') diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 92443c319e59..90016db7942d 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -353,10 +353,10 @@ static int detect_cru_service(void) asm(".text \n\t" ".align 4 \n\t" - ".globl asminline_call \n" + ".globl asminline_call \n\t" + ".type asminline_call, @function \n\t" "asminline_call: \n\t" - "pushq %rbp \n\t" - "movq %rsp, %rbp \n\t" + FRAME_BEGIN "pushq %rax \n\t" "pushq %rbx \n\t" "pushq %rdx \n\t" @@ -386,7 +386,7 @@ asm(".text \n\t" "popq %rdx \n\t" "popq %rbx \n\t" "popq %rax \n\t" - "leave \n\t" + FRAME_END "ret \n\t" ".previous"); -- cgit v1.2.3 From 1923f3d02768bd904dfe5607f3f93c3008b8db61 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 25 Feb 2016 08:27:27 +0100 Subject: watchdog/hpwdt: Fix build on certain configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following build failure: drivers/watchdog/hpwdt.c:359:5: error: expected ‘)’ before ‘FRAME_BEGIN’ which occurs because hpwdt.c relied on indirect inclusion to get asm/frame.h definitions - but some (mostly randconfig) configs did not provide that. Include explicitly. Cc: Josh Poimboeuf Cc: Andrew Morton Cc: Andy Lutomirski Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Brian Gerst Cc: Chris J Arges Cc: Denys Vlasenko Cc: Guenter Roeck Cc: H. Peter Anvin Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org Cc: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar --- drivers/watchdog/hpwdt.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/watchdog') diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 90016db7942d..8fc284cdce4e 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -37,6 +37,7 @@ #include #endif /* CONFIG_HPWDT_NMI_DECODING */ #include +#include #define HPWDT_VERSION "1.3.3" #define SECS_TO_TICKS(secs) ((secs) * 1000 / 128) -- cgit v1.2.3