Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1728682 > unrolled thread
| Started by | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| First post | 2017-09-08 10:30 +0200 |
| Last post | 2017-09-08 19:20 +0200 |
| Articles | 5 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] x86/idt: Unbreak MS HyperV hypercall vector install Thomas Gleixner <tglx@linutronix.de> - 2017-09-08 10:30 +0200
RE: [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install Haiyang Zhang <haiyangz@microsoft.com> - 2017-09-08 18:20 +0200
Re: [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install Stephen Hemminger <stephen@networkplumber.org> - 2017-09-08 19:00 +0200
Re: [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install Thomas Gleixner <tglx@linutronix.de> - 2017-09-08 19:10 +0200
RE: [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install KY Srinivasan <kys@microsoft.com> - 2017-09-08 19:20 +0200
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2017-09-08 10:30 +0200 |
| Subject | [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install |
| Message-ID | <unmPL-4eF-7@gated-at.bofh.it> |
The rework of the IDT setup changed the way how unused system gates are
accounted. At the end of the gate initialization all unused gates in the
system vector area are set to the spurios handler and marked as used for
consistency reasons.
Marking them as used breaks MS HyperV because it installs its hypercall
vector after that point and the installation is guarded by the bit in the
used_vectors map. So the hyperv vector stays directed to the spurious
interrupt handler.
Leave them marked as unused again and unbreak HyperV that way.
Fixes: dc20b2d52653 ("x86/idt: Move interrupt gate initialization to IDT code")
Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/idt.c | 1 -
1 file changed, 1 deletion(-)
--- a/arch/x86/kernel/idt.c
+++ b/arch/x86/kernel/idt.c
@@ -320,7 +320,6 @@ void __init idt_setup_apic_and_irq_gates
for_each_clear_bit_from(i, used_vectors, NR_VECTORS) {
#ifdef CONFIG_X86_LOCAL_APIC
- set_bit(i, used_vectors);
set_intr_gate(i, spurious_interrupt);
#else
entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR);
[toc] | [next] | [standalone]
| From | Haiyang Zhang <haiyangz@microsoft.com> |
|---|---|
| Date | 2017-09-08 18:20 +0200 |
| Message-ID | <unuaC-VM-11@gated-at.bofh.it> |
| In reply to | #1728682 |
> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Sent: Friday, September 8, 2017 4:20 AM
> To: LKML <linux-kernel@vger.kernel.org>
> Cc: Stephen Hemminger <sthemmin@microsoft.com>; Simon Xiao
> <sixiao@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Steven Rostedt <rostedt@goodmis.org>; Peter
> Zijlstra <peterz@infradead.org>; Linus Torvalds <torvalds@linux-
> foundation.org>; Josh Poimboeuf <jpoimboe@redhat.com>; H. Peter Anvin
> <hpa@zytor.com>; Denys Vlasenko <dvlasenk@redhat.com>; Brian Gerst
> <brgerst@gmail.com>; Borislav Petkov <bp@alien8.de>; Andy Lutomirski
> <luto@kernel.org>
> Subject: [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install
>
> The rework of the IDT setup changed the way how unused system gates are
> accounted. At the end of the gate initialization all unused gates in the
> system vector area are set to the spurios handler and marked as used for
> consistency reasons.
>
> Marking them as used breaks MS HyperV because it installs its hypercall
> vector after that point and the installation is guarded by the bit in
> the
> used_vectors map. So the hyperv vector stays directed to the spurious
> interrupt handler.
>
> Leave them marked as unused again and unbreak HyperV that way.
>
> Fixes: dc20b2d52653 ("x86/idt: Move interrupt gate initialization to IDT
> code")
> Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Thanks for the quick response.
I tested the patch and the kernel boots up on Hyper-V now.
Reviewed-and-Tested-by: Haiyang Zhang <haiyangz@microsoft.com>
[toc] | [prev] | [next] | [standalone]
| From | Stephen Hemminger <stephen@networkplumber.org> |
|---|---|
| Date | 2017-09-08 19:00 +0200 |
| Message-ID | <unuNj-1b6-9@gated-at.bofh.it> |
| In reply to | #1728682 |
On Fri, 8 Sep 2017 01:19:52 -0700
"Thomas Gleixner" <tglx@linutronix.de> wrote:
> The rework of the IDT setup changed the way how unused system gates are
> accounted. At the end of the gate initialization all unused gates in the
> system vector area are set to the spurios handler and marked as used for
> consistency reasons.
>
> Marking them as used breaks MS HyperV because it installs its hypercall
> vector after that point and the installation is guarded by the bit in the
> used_vectors map. So the hyperv vector stays directed to the spurious
> interrupt handler.
>
> Leave them marked as unused again and unbreak HyperV that way.
>
> Fixes: dc20b2d52653 ("x86/idt: Move interrupt gate initialization to IDT
> code")
> Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This fixes it, thanks.
Tested-by: Stephen Hemminger <sthemmin@microsoft.com>
[toc] | [prev] | [next] | [standalone]
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2017-09-08 19:10 +0200 |
| Message-ID | <unuWZ-1th-5@gated-at.bofh.it> |
| In reply to | #1729086 |
On Fri, 8 Sep 2017, Stephen Hemminger wrote:
> On Fri, 8 Sep 2017 01:19:52 -0700
> "Thomas Gleixner" <tglx@linutronix.de> wrote:
>
> > The rework of the IDT setup changed the way how unused system gates are
> > accounted. At the end of the gate initialization all unused gates in the
> > system vector area are set to the spurios handler and marked as used for
> > consistency reasons.
> >
> > Marking them as used breaks MS HyperV because it installs its hypercall
> > vector after that point and the installation is guarded by the bit in the
> > used_vectors map. So the hyperv vector stays directed to the spurious
> > interrupt handler.
> >
> > Leave them marked as unused again and unbreak HyperV that way.
> >
> > Fixes: dc20b2d52653 ("x86/idt: Move interrupt gate initialization to IDT
> > code")
> > Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>
> This fixes it, thanks.
>
> Tested-by: Stephen Hemminger <sthemmin@microsoft.com>
What's the reason that the vector is not set up early in the boot process?
Thanks,
tglx
[toc] | [prev] | [next] | [standalone]
| From | KY Srinivasan <kys@microsoft.com> |
|---|---|
| Date | 2017-09-08 19:20 +0200 |
| Message-ID | <unv6G-1yj-15@gated-at.bofh.it> |
| In reply to | #1729092 |
> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Sent: Friday, September 8, 2017 10:09 AM
> To: Stephen Hemminger <stephen@networkplumber.org>
> Cc: LKML <linux-kernel@vger.kernel.org>; Stephen Hemminger
> <sthemmin@microsoft.com>; Simon Xiao <sixiao@microsoft.com>; KY
> Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Steven Rostedt <rostedt@goodmis.org>; Peter
> Zijlstra <peterz@infradead.org>; Linus Torvalds <torvalds@linux-
> foundation.org>; Josh Poimboeuf <jpoimboe@redhat.com>; H. Peter Anvin
> <hpa@zytor.com>; Denys Vlasenko <dvlasenk@redhat.com>; Brian Gerst
> <brgerst@gmail.com>; Borislav Petkov <bp@alien8.de>; Andy Lutomirski
> <luto@kernel.org>
> Subject: Re: [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install
>
> On Fri, 8 Sep 2017, Stephen Hemminger wrote:
> > On Fri, 8 Sep 2017 01:19:52 -0700
> > "Thomas Gleixner" <tglx@linutronix.de> wrote:
> >
> > > The rework of the IDT setup changed the way how unused system gates
> are
> > > accounted. At the end of the gate initialization all unused gates in the
> > > system vector area are set to the spurios handler and marked as used for
> > > consistency reasons.
> > >
> > > Marking them as used breaks MS HyperV because it installs its hypercall
> > > vector after that point and the installation is guarded by the bit in the
> > > used_vectors map. So the hyperv vector stays directed to the spurious
> > > interrupt handler.
> > >
> > > Leave them marked as unused again and unbreak HyperV that way.
> > >
> > > Fixes: dc20b2d52653 ("x86/idt: Move interrupt gate initialization to IDT
> > > code")
> > > Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
> > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> >
> > This fixes it, thanks.
> >
> > Tested-by: Stephen Hemminger <sthemmin@microsoft.com>
>
> What's the reason that the vector is not set up early in the boot process?
No specific reason other than that was the way I had coded it up initially. I will send in a patch to
fix that.
Regards,
K. Y
>
> Thanks,
>
> tglx
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web