[RESUBMIT][PATCH] x86/mm: Fix PAT bit missing from page protection modify mask

Juergen Gross jgross at suse.com
Fri Jun 2 14:53:30 UTC 2023


On 02.06.23 16:48, Juergen Gross wrote:
> On 02.06.23 16:43, Borislav Petkov wrote:
>> On Thu, Jun 01, 2023 at 10:47:39AM +0200, Juergen Gross wrote:
>>> As described in the commit message, this only works on bare metal due to the
>>> PAT bit not being needed for WC mappings.
>>>
>>> Making this patch Xen specific would try to cure the symptoms without fixing
>>> the underlying problem: _PAGE_PAT should be regarded the same way as the bits
>>> for caching mode (_PAGE_CHG_MASK).
>>
>> So why isn't _PAGE_PAT part of _PAGE_CHG_MASK?
> 
> This would result in problems for large pages: _PAGE_PSE is at the same
> position as _PAGE_PAT (large pages are using _PAGE_PAT_LARGE instead).
> 
> Yes, x86 ABI is a mess.

Oh, wait: I originally thought _PAGE_CHG_MASK would be used for large pages,
too. There is _HPAGE_CHG_MASK for that purpose.

So adding _PAGE_PAT to _PAGE_CHG_MASK and _PAGE_PAT_LARGE to _HPAGE_CHG_MASK
should do the job. At least I hope so.


Juergen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xB0DE9DD628BF132F.asc
Type: application/pgp-keys
Size: 3098 bytes
Desc: OpenPGP public key
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230602/37864bf0/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230602/37864bf0/attachment.sig>


More information about the dri-devel mailing list