Mailing List Archive

Howto read MSR thermal under XEN-4.15.0
Hi,

how can i read the MSR Thermal Values under XEN-4.15.0 ?

Usually without having XEN-4.15.0 installed i can read the MSR Thermal Values like this:

rdmsr -p 0 -d -f22:16 0x19c

this works for my Core2Quod Q6600.

But after having xen-4.15.0 installed and booted, same command shows now: 0


Best Regards

B. S.
Re: Howto read MSR thermal under XEN-4.15.0 [ In reply to ]
(+ Andrew and Jan)

Hi,

On 16/06/2021 23:39, Bobbi Sanchez wrote:
> Hi,
>
> how can i read the MSR Thermal Values under XEN-4.15.0 ?
>
> Usually without having XEN-4.15.0 installed i can read the MSR Thermal
> Values like this:
>
> rdmsr -p 0 -d -f22:16 0x19c
>
> this works for my Core2Quod Q6600.
>
> But after having xen-4.15.0 installed and booted, same command shows now: 0

I believe the access was restricted as part of XSA-351 [1]. I am not
sure if there are a safe generic way to access them. I will let Andrew
and Jan commenting.

[1] https://xenbits.xen.org/xsa/advisory-351.html
>
>
> Best Regards
>
> B. S.
>
>

--
Julien Grall
Re: Howto read MSR thermal under XEN-4.15.0 [ In reply to ]
On 17/06/2021 12:09, Julien Grall wrote:
> (+ Andrew and Jan)
>
> Hi,
>
> On 16/06/2021 23:39, Bobbi Sanchez wrote:
>> Hi,
>>
>> how can i read the MSR Thermal Values under XEN-4.15.0 ?
>>
>> Usually without having XEN-4.15.0 installed i can read the MSR
>> Thermal Values like this:
>>
>> rdmsr -p 0 -d -f22:16 0x19c
>>
>> this works for my Core2Quod Q6600.
>>
>> But after having xen-4.15.0 installed and booted, same command shows
>> now: 0
>
> I believe the access was restricted as part of XSA-351 [1]. I am not
> sure if there are a safe generic way to access them. I will let Andrew
> and Jan commenting.

This method was never safe to begin with, because dom0 is just a VM and
can be migrated around.  If you pin dom0, then you're still can't access
registers who's scope is missing from where dom0 is pinned.

I'm afraid this is something which has never worked correctly under Xen,
but used to give enough of an illusion of working for people to think
that it did work.

Someone needs to come up with a plan to paravirtualise this interface,
probably using XENPLAT_resource_op, so tools in dom0 can actually read
the registers they think they're trying to access.

~Andrew
Re: Howto read MSR thermal under XEN-4.15.0 [ In reply to ]
On 17.06.2021 13:09, Julien Grall wrote:
> On 16/06/2021 23:39, Bobbi Sanchez wrote:
>> how can i read the MSR Thermal Values under XEN-4.15.0 ?
>>
>> Usually without having XEN-4.15.0 installed i can read the MSR Thermal
>> Values like this:
>>
>> rdmsr -p 0 -d -f22:16 0x19c
>>
>> this works for my Core2Quod Q6600.
>>
>> But after having xen-4.15.0 installed and booted, same command shows now: 0
>
> I believe the access was restricted as part of XSA-351 [1]. I am not
> sure if there are a safe generic way to access them. I will let Andrew
> and Jan commenting.

just as additional context (i.e. on top of Andrew's reply): It wasn't
that XSA, but our general switch of policy from blacklisting to
whitelisting MSRs. The XSA was about *_POWER_* and *_PERF_* MSRs.

Jan
Re: Howto read MSR thermal under XEN-4.15.0 [ In reply to ]
On 17/06/2021 12:26, Jan Beulich wrote:
> On 17.06.2021 13:09, Julien Grall wrote:
>> On 16/06/2021 23:39, Bobbi Sanchez wrote:
>>> how can i read the MSR Thermal Values under XEN-4.15.0 ?
>>>
>>> Usually without having XEN-4.15.0 installed i can read the MSR Thermal
>>> Values like this:
>>>
>>> rdmsr -p 0 -d -f22:16 0x19c
>>>
>>> this works for my Core2Quod Q6600.
>>>
>>> But after having xen-4.15.0 installed and booted, same command shows now: 0
>> I believe the access was restricted as part of XSA-351 [1]. I am not
>> sure if there are a safe generic way to access them. I will let Andrew
>> and Jan commenting.
> just as additional context (i.e. on top of Andrew's reply): It wasn't
> that XSA, but our general switch of policy from blacklisting to
> whitelisting MSRs. The XSA was about *_POWER_* and *_PERF_* MSRs.

Well - that XSA was the trigger for finally removing default read access
from all VMs, but yes - this specific issue described here only on Xen
4.15 and later.

You can use boot with dom0=msr-relaxed to regain read access, but will
still be subject to all the reasons I explained before about this not
actually working properly.

~Andrew
Re: Howto read MSR thermal under XEN-4.15.0 [ In reply to ]
Am 17.06.21 um 13:43 schrieb Andrew Cooper:
> On 17/06/2021 12:26, Jan Beulich wrote:
>> On 17.06.2021 13:09, Julien Grall wrote:
>>> On 16/06/2021 23:39, Bobbi Sanchez wrote:
>>>> how can i read the MSR Thermal Values under XEN-4.15.0 ?
>>>>
>>>> Usually without having XEN-4.15.0 installed i can read the MSR Thermal
>>>> Values like this:
>>>>
>>>> rdmsr -p 0 -d -f22:16 0x19c
>>>>
>>>> this works for my Core2Quod Q6600.
>>>>
>>>> But after having xen-4.15.0 installed and booted, same command shows now: 0
>>> I believe the access was restricted as part of XSA-351 [1]. I am not
>>> sure if there are a safe generic way to access them. I will let Andrew
>>> and Jan commenting.
>> just as additional context (i.e. on top of Andrew's reply): It wasn't
>> that XSA, but our general switch of policy from blacklisting to
>> whitelisting MSRs. The XSA was about *_POWER_* and *_PERF_* MSRs.
> Well - that XSA was the trigger for finally removing default read access
> from all VMs, but yes - this specific issue described here only on Xen
> 4.15 and later.
>
> You can use boot with dom0=msr-relaxed to regain read access, but will
> still be subject to all the reasons I explained before about this not
> actually working properly.
>
> ~Andrew
>
>
Hi Andrew,

thanks for hint, but thermal temps are not shown also after appending  that boot paramter to grub "dom0=msr-relxaed"!

 Is there any  other choice to access the thermal temps under xen-4.15.0 ?

Best Regards