RE: [PATCH] x86/idt: Unbreak MS HyperV hypercall vector install

From: Haiyang Zhang
Date: Fri Sep 08 2017 - 12:12:53 EST




> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@xxxxxxxxxxxxx]
> Sent: Friday, September 8, 2017 4:20 AM
> To: LKML <linux-kernel@xxxxxxxxxxxxxxx>
> Cc: Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>; Simon Xiao
> <sixiao@xxxxxxxxxxxxx>; KY Srinivasan <kys@xxxxxxxxxxxxx>; Haiyang Zhang
> <haiyangz@xxxxxxxxxxxxx>; Steven Rostedt <rostedt@xxxxxxxxxxx>; Peter
> Zijlstra <peterz@xxxxxxxxxxxxx>; Linus Torvalds <torvalds@linux-
> foundation.org>; Josh Poimboeuf <jpoimboe@xxxxxxxxxx>; H. Peter Anvin
> <hpa@xxxxxxxxx>; Denys Vlasenko <dvlasenk@xxxxxxxxxx>; Brian Gerst
> <brgerst@xxxxxxxxx>; Borislav Petkov <bp@xxxxxxxxx>; Andy Lutomirski
> <luto@xxxxxxxxxx>
> 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@xxxxxxxxxxxxx>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

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