lkml.org 
[lkml]   [2023]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3.1 10/12] x86/mtrr: use new cache_map in mtrr_type_lookup()
From
On 26.02.23 18:00, Michael Kelley (LINUX) wrote:
> From: Juergen Gross <jgross@suse.com> Sent: Thursday, February 23, 2023 10:37 PM
>>
>> Instead of crawling through the MTRR register state, use the new
>> cache_map for looking up the cache type(s) of a memory region.
>>
>> This allows now to set the uniform parameter according to the
>> uniformity of the cache mode of the region, instead of setting it
>> only if the complete region is mapped by a single MTRR. This now
>> includes even the region covered by the fixed MTRR registers.
>>
>> Make sure uniform is always set.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>> V3:
>> - new patch
>> V3.1:
>> - fix type_merge() (Michael Kelley)
>
> Thanks. This version fixes the problem I previously reported with a normal
> VM.
>
> However, I'm seeing a different problem in a Confidential VM where
> mtrr_overwrite_state() is used. In this case, we have no MTRRs, and when
> mtrr_copy_map() is called, the copy is not done, and cache_map is set
> to NULL. Subsequently when mtrr_type_lookup() is called, the check
> for a NULL cache_map causes MTRR_TYPE_UNCACHABLE to be returned.
> Then we're back to the original problem where pat_x_mtrr_type()
> returns UC- instead of WB.

Sigh. Just removing the test for cache_map being NULL in mtrr_type_lookup()
should do the job.

Will send V4 soon.


Juergen
[unhandled content-type:application/pgp-keys][unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-03-27 00:36    [W:0.045 / U:1.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site