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


Groups > linux.kernel > #1729345 > unrolled thread

[PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot

Started bykys@exchange.microsoft.com
First post2017-09-09 01:20 +0200
Last post2017-09-09 18:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot  kys@exchange.microsoft.com - 2017-09-09 01:20 +0200
    Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot Dan Carpenter <dan.carpenter@oracle.com> - 2017-09-09 13:10 +0200
      RE: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot KY Srinivasan <kys@microsoft.com> - 2017-09-09 18:10 +0200

#1729345 — [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot

Fromkys@exchange.microsoft.com
Date2017-09-09 01:20 +0200
Subject[PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot
Message-ID<unAJ4-5kM-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1729428

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-09-09 13:10 +0200
Message-ID<unLOa-4CV-39@gated-at.bofh.it>
In reply to#1729345
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

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


#1729478

FromKY Srinivasan <kys@microsoft.com>
Date2017-09-09 18:10 +0200
Message-ID<unQut-7Oz-5@gated-at.bofh.it>
In reply to#1729428

> -----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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web