RE: Optimized clocksource with AMD AVIC enabled for Windows guest

2021-02-04 Thread Vitaly Kuznetsov
Kechen Lu writes: > Hi Vitaly and Paolo, > > Thanks so much for quick reply. This makes sense to me. From my > understanding, basically this can be two part of it to resolve it. > > First, we make sure to set and expose 0x4004.EAX Bit9 to windows guest, > like in kvm_vcpu_ioctl_get_hv_cpui

Re: Optimized clocksource with AMD AVIC enabled for Windows guest

2021-02-04 Thread Paolo Bonzini
On 04/02/21 13:24, Vitaly Kuznetsov wrote: I checked Linux VMs on genuine Hyper-V and surprisingly 'HV_DEPRECATING_AEOI_RECOMMENDED' is not exposed. Did the host have APICv/AVIC (and can Hyper-V use AVIC)? AutoEOI is still a useful optimization on hosts that don't have hardware-accelerated E

Re: Optimized clocksource with AMD AVIC enabled for Windows guest

2021-02-04 Thread Vitaly Kuznetsov
Paolo Bonzini writes: > On 04/02/21 13:24, Vitaly Kuznetsov wrote: >> I checked Linux VMs on genuine Hyper-V and surprisingly >> 'HV_DEPRECATING_AEOI_RECOMMENDED' is not exposed. > > Did the host have APICv/AVIC (and can Hyper-V use AVIC)? AutoEOI is > still a useful optimization on hosts that

Re: Optimized clocksource with AMD AVIC enabled for Windows guest

2021-02-04 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > + > + auto_eoi_new = bitmap_weight(synic->auto_eoi_bitmap, 256); > + > + /* Hyper-V SynIC auto EOI SINT's are not compatible with APICV */ > + if (!auto_eoi_old && auto_eoi_new) { > + if (atomic_inc_return(&hv->synic_auto_eoi_used) == 1) > +

RE: Optimized clocksource with AMD AVIC enabled for Windows guest

2021-02-04 Thread Kechen Lu
Cool! Thanks for correction, yeah, APICV_INHIBIT_REASON_HYPERV setting is per-VM while synic is per-vCPU. Since the machine with AVIC is not in my hands today, I will test it hopefully by end of this week:) BR, Kechen >-Original Message- >From: Vitaly Kuznetsov >Sent: Thursday, Februar