Re: [PATCH v5] hyperv: root partition faults writing to VP ASSIST MSR PAGE
From: Wei Liu
Date: Wed Aug 04 2021 - 08:21:00 EST
On Mon, Aug 02, 2021 at 12:51:33PM +0000, Wei Liu wrote:
> On Sat, Jul 31, 2021 at 05:35:19PM +0530, Praveen Kumar wrote:
> > 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 page 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 unmaped in hv_cpu_die during teardown.
> >
> > Signed-off-by: Praveen Kumar <kumarpraveen@xxxxxxxxxxxxxxxxxxx>
>
> Looks good. I can fix a few styling issues in code and comments when I
> commit this patch.
Applied to hyperv-next. Thanks.
Wei.
>
> Wei.