[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#503821: Purpose of features/all/xen/workaround-pte-file.patch?



On Wed, Nov 05, 2008 at 01:10:30PM +0000, Ian Campbell wrote:
> On Wed, 2008-11-05 at 10:05 +0000, Ian Campbell wrote:
> > > What happens if you use "nopat" to disable the usage of PAT?
> > CONFIG_X86_PAT is disabled anyway so it makes no difference.
> Although it does turn out that PAT is implicated...

Ah.

>  /* Set of bits not changed in pte_modify */
> -#define _PAGE_CHG_MASK	(PTE_MASK | _PAGE_CACHE_MASK | _PAGE_IO |	\
> +#define _PAGE_CHG_MASK	(PTE_MASK | _PAGE_PCD | _PAGE_PWT | _PAGE_IO |	\
>  			 _PAGE_ACCESSED | _PAGE_DIRTY)

This is the direct expansion, why?

> +#else
> +	/* This is identical to page table setting without PAT */
> +	if (ret_type) {
> +		if (req_type == -1) {
> +			*ret_type = _PAGE_CACHE_WB;
> +		} else {
> +			*ret_type = req_type;
> +		}
> +	}
> +	return 0;
> +#endif

Code duplication. Better force pat_wc_enabled to 0 and let the compiler
do this instead of forcing the knowledge into the preprocessor.

I would also make several parts dependant on _PAGE_CACHE_WC instead of
X86_PAT.

Bastian

-- 
Killing is wrong.
		-- Losira, "That Which Survives", stardate unknown



Reply to: