Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1201998 > unrolled thread

[PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.

Started by"K. Y. Srinivasan" <kys@microsoft.com>
First post2015-08-06 22:20 +0200
Last post2015-08-10 13:20 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue. "K. Y. Srinivasan" <kys@microsoft.com> - 2015-08-06 22:20 +0200
    Re: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue. Greg KH <gregkh@linuxfoundation.org> - 2015-08-06 23:20 +0200
      RE: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue. KY Srinivasan <kys@microsoft.com> - 2015-08-07 05:40 +0200
        Re: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue. Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-08-10 13:20 +0200

#1201998 — [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.

From"K. Y. Srinivasan" <kys@microsoft.com>
Date2015-08-06 22:20 +0200
Subject[PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.
Message-ID<pUzNT-2I6-17@gated-at.bofh.it>
Building with a random configuration file, this build failure
was reported:

arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
arch/x86/kernel/cpu/mshyperv.c:112: undefined
reference to `native_machine_crash_shutdown'

This patch fixes the problem

Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 arch/x86/kernel/cpu/mshyperv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index f794bfa..0faed5e0 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
 {
 	if (hv_crash_handler)
 		hv_crash_handler(regs);
+#ifdef CONFIG_KEXEC_CORE
 	native_machine_crash_shutdown(regs);
+#endif
 }
 
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1202084

FromGreg KH <gregkh@linuxfoundation.org>
Date2015-08-06 23:20 +0200
Message-ID<pUAJX-43V-1@gated-at.bofh.it>
In reply to#1201998
On Thu, Aug 06, 2015 at 02:41:24PM -0700, K. Y. Srinivasan wrote:
> Building with a random configuration file, this build failure
> was reported:
> 
> arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
> arch/x86/kernel/cpu/mshyperv.c:112: undefined
> reference to `native_machine_crash_shutdown'
> 
> This patch fixes the problem
> 
> Reported-by: Jim Davis <jim.epost@gmail.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  arch/x86/kernel/cpu/mshyperv.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index f794bfa..0faed5e0 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
>  {
>  	if (hv_crash_handler)
>  		hv_crash_handler(regs);
> +#ifdef CONFIG_KEXEC_CORE
>  	native_machine_crash_shutdown(regs);
> +#endif

Why is kexec the factor here?  And if it really does, can't it just be
CONFIG_KEXEC, or, can kexec provide a "dummy" inline function so that
you don't have to have a #ifdef in a .c file?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1202267

FromKY Srinivasan <kys@microsoft.com>
Date2015-08-07 05:40 +0200
Message-ID<pUGFH-45g-3@gated-at.bofh.it>
In reply to#1202084

> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Thursday, August 6, 2015 2:11 PM
> To: KY Srinivasan <kys@microsoft.com>
> Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
> vkuznets@redhat.com; sfr@canb.auug.org.au; tglx@linutronix.de;
> mingo@redhat.com; hpa@zytor.com; x86@kernel.org; Haiyang Zhang
> <haiyangz@microsoft.com>
> Subject: Re: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.
> 
> On Thu, Aug 06, 2015 at 02:41:24PM -0700, K. Y. Srinivasan wrote:
> > Building with a random configuration file, this build failure
> > was reported:
> >
> > arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
> > arch/x86/kernel/cpu/mshyperv.c:112: undefined
> > reference to `native_machine_crash_shutdown'
> >
> > This patch fixes the problem
> >
> > Reported-by: Jim Davis <jim.epost@gmail.com>
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > ---
> >  arch/x86/kernel/cpu/mshyperv.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/x86/kernel/cpu/mshyperv.c
> b/arch/x86/kernel/cpu/mshyperv.c
> > index f794bfa..0faed5e0 100644
> > --- a/arch/x86/kernel/cpu/mshyperv.c
> > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > @@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct
> pt_regs *regs)
> >  {
> >  	if (hv_crash_handler)
> >  		hv_crash_handler(regs);
> > +#ifdef CONFIG_KEXEC_CORE
> >  	native_machine_crash_shutdown(regs);
> > +#endif
> 
> Why is kexec the factor here?  And if it really does, can't it just be
> CONFIG_KEXEC, or, can kexec provide a "dummy" inline function so that
> you don't have to have a #ifdef in a .c file?

Greg,

I am on vacation till next Tuesday. I will address your concern after I get back if Vitaly
has not addressed it by then.

Regards,

K. Y

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204171

FromVitaly Kuznetsov <vkuznets@redhat.com>
Date2015-08-10 13:20 +0200
Message-ID<pVThw-4Hc-1@gated-at.bofh.it>
In reply to#1202267
KY Srinivasan <kys@microsoft.com> writes:

>> -----Original Message-----
>> From: Greg KH [mailto:gregkh@linuxfoundation.org]
>> Sent: Thursday, August 6, 2015 2:11 PM
>> To: KY Srinivasan <kys@microsoft.com>
>> Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
>> vkuznets@redhat.com; sfr@canb.auug.org.au; tglx@linutronix.de;
>> mingo@redhat.com; hpa@zytor.com; x86@kernel.org; Haiyang Zhang
>> <haiyangz@microsoft.com>
>> Subject: Re: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.
>> 
>> On Thu, Aug 06, 2015 at 02:41:24PM -0700, K. Y. Srinivasan wrote:
>> > Building with a random configuration file, this build failure
>> > was reported:
>> >
>> > arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
>> > arch/x86/kernel/cpu/mshyperv.c:112: undefined
>> > reference to `native_machine_crash_shutdown'
>> >
>> > This patch fixes the problem
>> >
>> > Reported-by: Jim Davis <jim.epost@gmail.com>
>> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
>> > ---
>> >  arch/x86/kernel/cpu/mshyperv.c |    2 ++
>> >  1 files changed, 2 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
>> > index f794bfa..0faed5e0 100644
>> > --- a/arch/x86/kernel/cpu/mshyperv.c
>> > +++ b/arch/x86/kernel/cpu/mshyperv.c
>> > @@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
>> >  {
>> >  	if (hv_crash_handler)
>> >  		hv_crash_handler(regs);
>> > +#ifdef CONFIG_KEXEC_CORE
>> >  	native_machine_crash_shutdown(regs);
>> > +#endif
>> 
>> Why is kexec the factor here?  And if it really does, can't it just be
>> CONFIG_KEXEC, or, can kexec provide a "dummy" inline function so that
>> you don't have to have a #ifdef in a .c file?
>
> Greg,
>
> I am on vacation till next Tuesday. I will address your concern after I get back if Vitaly
> has not addressed it by then.

I think the issue is not Hyper-V-related: we have
native_machine_crash_shutdown() defined in asm/reboot.h but its
implementation in kernel/crash.c is only being compiled with
CONFIG_KEXEC. I suggest we fix it with something like the following:

diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h
index a82c4f1..6763e3e 100644
--- a/arch/x86/include/asm/reboot.h
+++ b/arch/x86/include/asm/reboot.h
@@ -16,8 +16,15 @@ struct machine_ops {

extern struct machine_ops machine_ops;

-void native_machine_crash_shutdown(struct pt_regs *regs);
void native_machine_shutdown(void);
+#ifdef CONFIG_KEXEC
+void native_machine_crash_shutdown(struct pt_regs *regs);
+#else
+static inline void native_machine_crash_shutdown(struct pt_regs *regs)
+{
+       native_machine_shutdown();
+}
+#endif
void __noreturn machine_real_restart(unsigned int type);
/* These must match dispatch in arch/x86/realmore/rm/reboot.S */
#define MRR_BIOS       0

I'll post a patch if there are no objections.

-- 
  Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web