]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/paravirt: Use pte_val instead of pte_flags on CPA pageattr_test
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 4 Nov 2011 17:18:15 +0000 (13:18 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 13 Dec 2011 15:56:07 +0000 (10:56 -0500)
commit8cfa86623c75457aa2eec12e15ff7fd0b9fbf035
tree297a688a9f84abba289351a918997d945f0ad80e
parent9a3e82929965aa60da9c494f77b2cb05eac32015
x86/paravirt: Use pte_val instead of pte_flags on CPA pageattr_test

For details refer to patch "x86/paravirt: Use pte_attrs instead of
pte_flags on CPA/set_p.._wb/wc operations." which explains that
some pages have the _PAGE_PWT bit set in the _PAGE_PSE field
when running under Xen.

When pageattr_test is running it uses pte_flags to check whether
it succedded in setting _PAGE_UNUSED1 bit, but also whether the
page had _PAGE_PSE. This can happen when one of the randomly selected
pages to be tested is a page that has been set to be _PAGE_WC
as under Xen, that field is under _PAGE_PSE. Since the 'pte_huge'
call is using the pte_flags(x) macro, which extracts the "raw" contents
of the PTE, the translation of _PAGE_PSE -> _PAGE_PWT does not happen
and we incorrectly identify the PTE as bad.

Using the 'pte_val' instead of 'pte_flags' fixes the problem and
this patch does that.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: stable@kernel.org
arch/x86/mm/pageattr-test.c