• Praveen Kumar's avatar
    x86/hyperv: fix root partition faults when writing to VP assist page MSR · e5d9b714
    Praveen Kumar authored
    For root partition the VP assist pages are pre-determined by the
    hypervisor. The root kernel is not allowed to change them to
    different locations. And thus, we are getting below stack as in
    current implementation root is trying to perform write to specific
    MSR.
    
        [ 2.778197] unchecked MSR access error: WRMSR to 0x40000073 (tried to write 0x0000000145ac5001) at rIP: 0xffffffff810c1084 (native_write_msr+0x4/0x30)
        [ 2.784867] Call Trace:
        [ 2.791507] hv_cpu_init+0xf1/0x1c0
        [ 2.798144] ? hyperv_report_panic+0xd0/0xd0
        [ 2.804806] cpuhp_invoke_callback+0x11a/0x440
        [ 2.811465] ? hv_resume+0x90/0x90
        [ 2.818137] cpuhp_issue_call+0x126/0x130
        [ 2.824782] __cpuhp_setup_state_cpuslocked+0x102/0x2b0
        [ 2.831427] ? hyperv_report_panic+0xd0/0xd0
        [ 2.838075] ? hyperv_report_panic+0xd0/0xd0
        [ 2.844723] ? hv_resume+0x90/0x90
        [ 2.851375] __cpuhp_setup_state+0x3d/0x90
        [ 2.858030] hyperv_init+0x14e/0x410
        [ 2.864689] ? enable_IR_x2apic+0x190/0x1a0
        [ 2.871349] apic_intr_mode_init+0x8b/0x100
        [ 2.878017] x86_late_time_init+0x20/0x30
        [ 2.884675] start_kernel+0x459/0x4fb
        [ 2.891329] secondary_startup_64_no_verify+0xb0/0xbb
    
    Since the hypervisor already provides the VP assist pages for root
    partition, we need to memremap the memory from hypervisor for root
    kernel to use. The mapping is done in hv_cpu_init during bringup and is
    unmapped in hv_cpu_die during teardown.
    Signed-off-by: default avatarPraveen Kumar <kumarpraveen@linux.microsoft.com>
    Reviewed-by: default avatarSunil Muthuswamy <sunilmut@microsoft.com>
    Link: https://lore.kernel.org/r/20210731120519.17154-1-kumarpraveen@linux.microsoft.comSigned-off-by: default avatarWei Liu <wei.liu@kernel.org>
    e5d9b714
hv_init.c 14.7 KB