Skip to contentSkip to conversation

x86/hyper-V: Allocate the IDT entry early in boot

PATCH In review K. Y. Srinivasan 2 participants 3 messages Sep 8, 2017 – Sep 9, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

Allocate the hypervisor callback IDT entry early in the boot sequence.

---
 arch/x86/kernel/cpu/mshyperv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/mshyperv.c +2 -2
index 3b3f713e15e5..236324e83a3a 100644
@@ -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
 }
 
Signature · 1 line
2.14.1
#1 lore raw
Quoted 21 lines · K. Y. Srinivasan

Allocate the hypervisor callback IDT entry early in the boot sequence.

---
 arch/x86/kernel/cpu/mshyperv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/mshyperv.c +0 -2
index 3b3f713e15e5..236324e83a3a 100644
@@ -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)

arch/x86/kernel/cpu/mshyperv.c static void __init ms_hyperv_init_platform(void) · line 255

Quoted 7 lines
arch/x86/kernel/cpu/mshyperv.c +2 -0
@@ -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
 }

Nice. So we can make all of that gate/idt stuff __init now.

That makes my previous fix obsolete, right?

Thanks,

tglx

#2 lore raw
Quoted 43 lines

-----Original Message-----
From: Thomas Gleixner [mailto:[email protected]]
Sent: Saturday, September 9, 2017 2:40 AM
To: KY Srinivasan <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] x86/hyper-V: Allocate the IDT entry early in boot

Review

Quoted 8 lines · K. Y. Srinivasan

Allocate the hypervisor callback IDT entry early in the boot sequence.

---
 arch/x86/kernel/cpu/mshyperv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/arch/x86/kernel/cpu/mshyperv.c

arch/x86/kernel/cpu/mshyperv.c void hyperv_vector_handler(struct pt_regs *regs) · line 63

Quoted 9 lines

index 3b3f713e15e5..236324e83a3a 100644

arch/x86/kernel/cpu/mshyperv.c +0 -2
@@ -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);

arch/x86/kernel/cpu/mshyperv.c static void __init ms_hyperv_init_platform(void) · line 253

Quoted 9 lines
arch/x86/kernel/cpu/mshyperv.c +2 -0
 }
 
 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);

Quoted 6 lines

arch/x86/kernel/cpu/mshyperv.c static void __init ms_hyperv_init_platform(void) · line 255

Quoted 2 lines
arch/x86/kernel/cpu/mshyperv.c +0 -0
 #endif
 }

Nice. So we can make all of that gate/idt stuff __init now.

That makes my previous fix obsolete, right?

Yes.

K. Y

Quoted 5 lines

Thanks,

tglx