Re: [PATCH 05/13] HV: Add Write/Read MSR registers via ghcb page

2021-08-02 Thread Tianyu Lan
On 8/2/2021 8:28 PM, Joerg Roedel wrote: On Wed, Jul 28, 2021 at 10:52:20AM -0400, Tianyu Lan wrote: +void hv_ghcb_msr_write(u64 msr, u64 value) +{ + union hv_ghcb *hv_ghcb; + void **ghcb_base; + unsigned long flags; + + if (!ms_hyperv.ghcb_base) + return; +

Re: [PATCH 05/13] HV: Add Write/Read MSR registers via ghcb page

2021-08-02 Thread Joerg Roedel
On Wed, Jul 28, 2021 at 10:52:20AM -0400, Tianyu Lan wrote: > +void hv_ghcb_msr_write(u64 msr, u64 value) > +{ > + union hv_ghcb *hv_ghcb; > + void **ghcb_base; > + unsigned long flags; > + > + if (!ms_hyperv.ghcb_base) > + return; > + > + WARN_ON(in_nmi()); > + > +

[PATCH 05/13] HV: Add Write/Read MSR registers via ghcb page

2021-07-28 Thread Tianyu Lan
From: Tianyu Lan Hyper-V provides GHCB protocol to write Synthetic Interrupt Controller MSR registers in Isolation VM with AMD SEV SNP and these registers are emulated by hypervisor directly. Hyper-V requires to write SINTx MSR registers twice. First writes MSR via GHCB page to communicate with h