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]
Message-ID: <ZOM/8IVsRf3esyQ1@chao-email>
Date:   Mon, 21 Aug 2023 18:44:00 +0800
From:   Chao Gao <chao.gao@...el.com>
To:     Hao Xiang <hao.xiang@...ux.alibaba.com>
CC:     <kvm@...r.kernel.org>, <shannon.zhao@...ux.alibaba.com>,
        <pbonzini@...hat.com>, <seanjc@...gle.com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kvm: x86: emulate MSR_PLATFORM_INFO msr bits

On Mon, Aug 21, 2023 at 05:11:16PM +0800, Hao Xiang wrote:
>For reason that,
>
>The turbo frequency info depends on specific machine type. And the msr value
>of MSR_PLATFORM_INFO may be diferent on diffrent generation machine.
>
>Get following msr bits (needed by turbostat on intel platform) by rdmsr
>MSR_PLATFORM_INFO directly in KVM is more reasonable. And set these msr bits
>as vcpu->arch.msr_platform_info default value.
> -bit 15:8, Maximum Non-Turbo Ratio (MAX_NON_TURBO_LIM_RATIO)
> -bit 47:40, Maximum Efficiency Ratio (MAX_EFFICIENCY_RATIO)

I don't get why QEMU cannot do this with the existing interface, e.g.,
KVM_SET_MSRS.

will the MSR value be migrated during VM migration?

looks we are in a dilemma. on one side, if the value is migrated, the value can
become inconsisntent with hardware value. On the other side, changing the ratio
bits at runtime isn't the architectural behavior.

And the MSR is per-socket. In theory, a system can have two sockets with
different values of the MSR. what if a vCPU is created on a socket and then
later runs on the other socket?

>
>On 2023/8/21 15:52, Chao Gao wrote:
>> On Mon, Aug 21, 2023 at 11:26:32AM +0800, Hao Xiang wrote:
>> > For intel platform, The BzyMhz field of Turbostat shows zero
>> > due to the missing of part msr bits of MSR_PLATFORM_INFO.
>> > 
>> > Acquire necessary msr bits, and expose following msr info to guest,
>> > to make sure guest can get correct turbo frequency info.
>> 
>> Userspace VMM (e.g., QEMU) can configure this MSR for guests. Please refer to
>> tools/testing/selftests/kvm/x86_64/platform_info_test.c.
>> 
>> The question is why KVM needs this patch given KVM already provides interfaces
>> for QEMU to configure the MSR.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ