* [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
@ 2017-09-08 23:15 kys
2017-09-09 11:04 ` Dan Carpenter
2017-09-13 9:25 ` [tip:x86/urgent] " tip-bot for K. Y. Srinivasan
0 siblings, 2 replies; 6+ messages in thread
From: kys @ 2017-09-08 23:15 UTC (permalink / raw)
To: x86, gregkh, linux-kernel, devel, olaf, apw, jasowang, tglx, hpa,
mingo
Cc: K. Y. Srinivasan
From: "K. Y. Srinivasan" <kys@microsoft.com>
Allocate the hypervisor callback IDT entry early in the boot sequence.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
arch/x86/kernel/cpu/mshyperv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 3b3f713e15e5..236324e83a3a 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -59,8 +59,6 @@ void hyperv_vector_handler(struct pt_regs *regs)
void hv_setup_vmbus_irq(void (*handler)(void))
{
vmbus_handler = handler;
- /* Setup the IDT for hypervisor callback */
- alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
}
void hv_remove_vmbus_irq(void)
@@ -251,6 +249,8 @@ static void __init ms_hyperv_init_platform(void)
*/
x86_platform.apic_post_init = hyperv_init;
hyperv_setup_mmu_ops();
+ /* Setup the IDT for hypervisor callback */
+ alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
#endif
}
--
2.14.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
2017-09-08 23:15 [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot kys
@ 2017-09-09 11:04 ` Dan Carpenter
2017-09-09 16:00 ` KY Srinivasan
2017-09-13 9:25 ` [tip:x86/urgent] " tip-bot for K. Y. Srinivasan
1 sibling, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2017-09-09 11:04 UTC (permalink / raw)
To: kys; +Cc: x86, gregkh, linux-kernel, devel, olaf, apw, jasowang, tglx, hpa,
mingo
On Fri, Sep 08, 2017 at 04:15:57PM -0700, kys@exchange.microsoft.com wrote:
> From: "K. Y. Srinivasan" <kys@microsoft.com>
>
> Allocate the hypervisor callback IDT entry early in the boot sequence.
>
I'm guessing this fixes a NULL dereference or something? The changelog
doesn't really say why we are doing this.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
2017-09-09 11:04 ` Dan Carpenter
@ 2017-09-09 16:00 ` KY Srinivasan
2017-09-13 9:00 ` Ingo Molnar
0 siblings, 1 reply; 6+ messages in thread
From: KY Srinivasan @ 2017-09-09 16:00 UTC (permalink / raw)
To: Dan Carpenter
Cc: x86@kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com,
tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org
> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Saturday, September 9, 2017 4:04 AM
> To: KY Srinivasan <kys@microsoft.com>
> Cc: x86@kernel.org; gregkh@linuxfoundation.org; linux-
> kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; jasowang@redhat.com; tglx@linutronix.de;
> hpa@zytor.com; mingo@kernel.org
> Subject: Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
>
> On Fri, Sep 08, 2017 at 04:15:57PM -0700, kys@exchange.microsoft.com
> wrote:
> > From: "K. Y. Srinivasan" <kys@microsoft.com>
> >
> > Allocate the hypervisor callback IDT entry early in the boot sequence.
> >
>
> I'm guessing this fixes a NULL dereference or something? The changelog
> doesn't really say why we are doing this.
The changelog does say what we are doing - allocating the IDT entry early in the boot sequence.
The current code would allocate the entry as part of registering the handler when vmbus driver
loaded and this caused a problem for the cleanup Thomas had implemented.
K. Y
>
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
2017-09-09 16:00 ` KY Srinivasan
@ 2017-09-13 9:00 ` Ingo Molnar
2017-09-13 18:05 ` KY Srinivasan
0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2017-09-13 9:00 UTC (permalink / raw)
To: KY Srinivasan
Cc: Dan Carpenter, x86@kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com,
tglx@linutronix.de, hpa@zytor.com
* KY Srinivasan <kys@microsoft.com> wrote:
>
>
> > -----Original Message-----
> > From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> > Sent: Saturday, September 9, 2017 4:04 AM
> > To: KY Srinivasan <kys@microsoft.com>
> > Cc: x86@kernel.org; gregkh@linuxfoundation.org; linux-
> > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> > apw@canonical.com; jasowang@redhat.com; tglx@linutronix.de;
> > hpa@zytor.com; mingo@kernel.org
> > Subject: Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
> >
> > On Fri, Sep 08, 2017 at 04:15:57PM -0700, kys@exchange.microsoft.com
> > wrote:
> > > From: "K. Y. Srinivasan" <kys@microsoft.com>
> > >
> > > Allocate the hypervisor callback IDT entry early in the boot sequence.
> > >
> >
> > I'm guessing this fixes a NULL dereference or something? The changelog
> > doesn't really say why we are doing this.
>
> The changelog does say what we are doing - allocating the IDT entry early in the boot sequence.
But the question was the 'why', not the 'what' - so Dan's question is
fully justified ...
> The current code would allocate the entry as part of registering the handler
> when vmbus driver loaded and this caused a problem for the cleanup Thomas had
> implemented.
I've put this explanation into the changelog.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
2017-09-13 9:00 ` Ingo Molnar
@ 2017-09-13 18:05 ` KY Srinivasan
0 siblings, 0 replies; 6+ messages in thread
From: KY Srinivasan @ 2017-09-13 18:05 UTC (permalink / raw)
To: Ingo Molnar
Cc: Dan Carpenter, x86@kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com,
tglx@linutronix.de, hpa@zytor.com
> -----Original Message-----
> From: Ingo Molnar [mailto:mingo.kernel.org@gmail.com] On Behalf Of Ingo
> Molnar
> Sent: Wednesday, September 13, 2017 2:01 AM
> To: KY Srinivasan <kys@microsoft.com>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>; x86@kernel.org;
> gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com; tglx@linutronix.de; hpa@zytor.com
> Subject: Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
>
>
> * KY Srinivasan <kys@microsoft.com> wrote:
>
> >
> >
> > > -----Original Message-----
> > > From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> > > Sent: Saturday, September 9, 2017 4:04 AM
> > > To: KY Srinivasan <kys@microsoft.com>
> > > Cc: x86@kernel.org; gregkh@linuxfoundation.org; linux-
> > > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> > > apw@canonical.com; jasowang@redhat.com; tglx@linutronix.de;
> > > hpa@zytor.com; mingo@kernel.org
> > > Subject: Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
> > >
> > > On Fri, Sep 08, 2017 at 04:15:57PM -0700, kys@exchange.microsoft.com
> > > wrote:
> > > > From: "K. Y. Srinivasan" <kys@microsoft.com>
> > > >
> > > > Allocate the hypervisor callback IDT entry early in the boot sequence.
> > > >
> > >
> > > I'm guessing this fixes a NULL dereference or something? The changelog
> > > doesn't really say why we are doing this.
> >
> > The changelog does say what we are doing - allocating the IDT entry early in
> the boot sequence.
>
> But the question was the 'why', not the 'what' - so Dan's question is
> fully justified ...
>
> > The current code would allocate the entry as part of registering the handler
> > when vmbus driver loaded and this caused a problem for the cleanup
> Thomas had
> > implemented.
>
> I've put this explanation into the changelog.
You are right. Thanks, Ingo.
K. Y
>
> Thanks,
>
> Ingo
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tip:x86/urgent] x86/hyper-V: Allocate the IDT entry early in boot
2017-09-08 23:15 [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot kys
2017-09-09 11:04 ` Dan Carpenter
@ 2017-09-13 9:25 ` tip-bot for K. Y. Srinivasan
1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for K. Y. Srinivasan @ 2017-09-13 9:25 UTC (permalink / raw)
To: linux-tip-commits; +Cc: mingo, linux-kernel, peterz, tglx, kys, torvalds, hpa
Commit-ID: 213ff44ae4eb5224010166db2f851e4eea068268
Gitweb: http://git.kernel.org/tip/213ff44ae4eb5224010166db2f851e4eea068268
Author: K. Y. Srinivasan <kys@microsoft.com>
AuthorDate: Fri, 8 Sep 2017 16:15:57 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 13 Sep 2017 11:02:26 +0200
x86/hyper-V: Allocate the IDT entry early in boot
Allocate the hypervisor callback IDT entry early in the boot sequence.
The previous code would allocate the entry as part of registering the handler
when the vmbus driver loaded, and this caused a problem for the IDT cleanup
that Thomas is working on for v4.15.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: apw@canonical.com
Cc: devel@linuxdriverproject.org
Cc: gregkh@linuxfoundation.org
Cc: jasowang@redhat.com
Cc: olaf@aepfle.de
Link: http://lkml.kernel.org/r/20170908231557.2419-1-kys@exchange.microsoft.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/cpu/mshyperv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 3b3f713..236324e8 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -59,8 +59,6 @@ void hyperv_vector_handler(struct pt_regs *regs)
void hv_setup_vmbus_irq(void (*handler)(void))
{
vmbus_handler = handler;
- /* Setup the IDT for hypervisor callback */
- alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
}
void hv_remove_vmbus_irq(void)
@@ -251,6 +249,8 @@ static void __init ms_hyperv_init_platform(void)
*/
x86_platform.apic_post_init = hyperv_init;
hyperv_setup_mmu_ops();
+ /* Setup the IDT for hypervisor callback */
+ alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
#endif
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-09-13 18:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-08 23:15 [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot kys
2017-09-09 11:04 ` Dan Carpenter
2017-09-09 16:00 ` KY Srinivasan
2017-09-13 9:00 ` Ingo Molnar
2017-09-13 18:05 ` KY Srinivasan
2017-09-13 9:25 ` [tip:x86/urgent] " tip-bot for K. Y. Srinivasan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox