Messages in this thread | | | Date | Mon, 27 Feb 2023 08:11:06 +0100 | Subject | Re: [PATCH v3.1 10/12] x86/mtrr: use new cache_map in mtrr_type_lookup() | From | Juergen Gross <> |
| |
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] | |