lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 5 Jun 2020 13:28:30 +0800
From:   Like Xu <like.xu@...ux.intel.com>
To:     "Li,Rongqing" <lirongqing@...du.com>,
        "like.xu@...el.com" <like.xu@...el.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "jmattson@...gle.com" <jmattson@...gle.com>,
        "wanpengli@...cent.com" <wanpengli@...cent.com>,
        "vkuznets@...hat.com" <vkuznets@...hat.com>,
        "sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "xiaoyao.li@...el.com" <xiaoyao.li@...el.com>,
        "wei.huang2@....com" <wei.huang2@....com>
Subject: Re: 答复: [PATCH][v6] KVM: X86: support APERF/MPERF registers

On 2020/6/5 12:23, Li,Rongqing wrote:
> 
> 
>> -----邮件原件-----
>> 发件人: Xu, Like [mailto:like.xu@...el.com]
>> 发送时间: 2020年6月5日 10:32
>> 收件人: Li,Rongqing <lirongqing@...du.com>
>> 抄送: linux-kernel@...r.kernel.org; kvm@...r.kernel.org; x86@...nel.org;
>> hpa@...or.com; bp@...en8.de; mingo@...hat.com; tglx@...utronix.de;
>> jmattson@...gle.com; wanpengli@...cent.com; vkuznets@...hat.com;
>> sean.j.christopherson@...el.com; pbonzini@...hat.com; xiaoyao.li@...el.com;
>> wei.huang2@....com
>> 主题: Re: [PATCH][v6] KVM: X86: support APERF/MPERF registers
>>
>> Hi RongQing,
>>
>> On 2020/6/5 9:44, Li RongQing wrote:
>>> Guest kernel reports a fixed cpu frequency in /proc/cpuinfo, this is
>>> confused to user when turbo is enable, and aperf/mperf can be used to
>>> show current cpu frequency after 7d5905dc14a
>>> "(x86 / CPU: Always show current CPU frequency in /proc/cpuinfo)"
>>> so guest should support aperf/mperf capability
>>>
>>> This patch implements aperf/mperf by three mode: none, software
>>> emulation, and pass-through
>>>
>>> None: default mode, guest does not support aperf/mperf
>> s/None/Note
>>>
>>> Software emulation: the period of aperf/mperf in guest mode are
>>> accumulated as emulated value
>>>
>>> Pass-though: it is only suitable for KVM_HINTS_REALTIME, Because that
>>> hint guarantees we have a 1:1 vCPU:CPU binding and guaranteed no
>>> over-commit.
>> The flag "KVM_HINTS_REALTIME 0" (in the Documentation/virt/kvm/cpuid.rst)
>> is claimed as "guest checks this feature bit to determine that vCPUs are never
>> preempted for an unlimited time allowing optimizations".
>>
>> I couldn't see its relationship with "1:1 vCPU: pCPU binding".
>> The patch doesn't check this flag as well for your pass-through purpose.
>>
>> Thanks,
>> Like Xu
> 
> 
> I think this is user space jobs to bind HINT_REALTIME and mperf passthrough, KVM just do what userspace wants.
> 

That's fine for user space to bind HINT_REALTIME and mperf passthrough,
But I was asking why HINT_REALTIME means "1:1 vCPU: pCPU binding".

As you said, "Pass-though: it is only suitable for KVM_HINTS_REALTIME",
which means, KVM needs to make sure the kvm->arch.aperfmperf_mode value
could "only" be set to KVM_APERFMPERF_PT when the check
kvm_para_has_hint(KVM_HINTS_REALTIME) is passed.

Specifically, the KVM_HINTS_REALTIME is a per-kvm capability
while the kvm_aperfmperf_mode is a per-vm capability. It's unresolved.

KVM doesn't always do what userspace wants especially
you're trying to expose some features about
power and thermal management in the virtualization context.

> and this gives user space a possibility, guest has passthrough mperfaperf without HINT_REALTIME, guest can get coarse cpu frequency without performance effect if guest can endure error frequency occasionally
> 


> 
> -Li
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ