mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Juergen Gross <jgross@suse.com>
Cc: hpa@zytor.com, x86@kernel.org, mingo@redhat.com,
	stefan.bader@canonical.com, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com, konrad.wilk@oracle.com,
	ville.syrjala@linux.intel.com, david.vrabel@citrix.com,
	jbeulich@suse.com, toshi.kani@hp.com, plagnioj@jcrosoft.com,
	tomi.valkeinen@ti.com, bhelgaas@google.com
Subject: Re: [PATCH 10/17] x86: Use new cache mode type in setting page attributes
Date: Fri, 31 Oct 2014 16:34:25 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1410311617260.5308@nanos> (raw)
In-Reply-To: <1414764033-30011-11-git-send-email-jgross@suse.com>

On Fri, 31 Oct 2014, Juergen Gross wrote:
> --- a/arch/x86/mm/pageattr.c
> +++ b/arch/x86/mm/pageattr.c
> @@ -1304,12 +1304,6 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
>  	return 0;
>  }
>  
> -static inline int cache_attr(pgprot_t attr)
> -{
> -	return pgprot_val(attr) &
> -		(_PAGE_PAT | _PAGE_PAT_LARGE | _PAGE_PWT | _PAGE_PCD);
> -}
> -
>  static int change_page_attr_set_clr(unsigned long *addr, int numpages,
>  				    pgprot_t mask_set, pgprot_t mask_clr,
>  				    int force_split, int in_flag,
> @@ -1390,7 +1384,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
>  	 * No need to flush, when we did not set any of the caching
>  	 * attributes:
>  	 */
> -	cache = cache_attr(mask_set);
> +	cache = !!pgprot2cachemode(mask_set);

So this loses _PAGE_PAT_LARGE, right ?

>  int set_memory_uc(unsigned long addr, int numpages)
> @@ -1456,7 +1451,7 @@ int set_memory_uc(unsigned long addr, int numpages)
>  	 * for now UC MINUS. see comments in ioremap_nocache()
>  	 */
>  	ret = reserve_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE,
> -			    _PAGE_CACHE_UC_MINUS, NULL);
> +			      _PAGE_CACHE_UC_MINUS, NULL);

That should be in the patch which added the _PAGE_CACHE_UC_MINUS

>  int _set_memory_wb(unsigned long addr, int numpages)
>  {
> +	/* WB cache mode is hard wired to all cache attribute bits being 0 */

I like the comment, but shouldn't we compile time check that
assumption somewhere?

>  	return change_page_attr_clear(&addr, numpages,
>  				      __pgprot(_PAGE_CACHE_MASK), 0);

Thanks,

	tglx

  reply	other threads:[~2014-10-31 15:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 14:00 [PATCH 00/17] x86: Full support of PAT Juergen Gross
2014-10-31 14:00 ` [PATCH 01/17] x86: Make page cache mode a real type Juergen Gross
2014-10-31 19:42   ` Borislav Petkov
2014-10-31 20:23     ` Konrad Rzeszutek Wilk
2014-10-31 20:35       ` Borislav Petkov
2014-11-03  6:36         ` Juergen Gross
2014-11-03 10:31           ` Thomas Gleixner
2014-10-31 20:28     ` Thomas Gleixner
2014-10-31 14:00 ` [PATCH 02/17] x86: Use new cache mode type in include/asm/fb.h Juergen Gross
2014-10-31 14:00 ` [PATCH 03/17] x86: Use new cache mode type in drivers/video/fbdev/gbefb.c Juergen Gross
2014-10-31 14:00 ` [PATCH 04/17] x86: Use new cache mode type in drivers/video/fbdev/vermilion Juergen Gross
2014-10-31 14:00 ` [PATCH 05/17] x86: Use new cache mode type in arch/x86/pci Juergen Gross
2014-10-31 14:00 ` [PATCH 06/17] x86: Use new cache mode type in arch/x86/mm/init_64.c Juergen Gross
2014-10-31 14:00 ` [PATCH 07/17] x86: Use new cache mode type in asm/pgtable.h Juergen Gross
2014-10-31 14:00 ` [PATCH 08/17] x86: Use new cache mode type in mm/iomap_32.c Juergen Gross
2014-10-31 14:00 ` [PATCH 09/17] x86: Use new cache mode type in track_pfn_remap() and track_pfn_insert() Juergen Gross
2014-10-31 14:00 ` [PATCH 10/17] x86: Use new cache mode type in setting page attributes Juergen Gross
2014-10-31 15:34   ` Thomas Gleixner [this message]
2014-11-03  6:32     ` Juergen Gross
2014-11-03 10:31       ` Thomas Gleixner
2014-10-31 14:00 ` [PATCH 11/17] x86: Use new cache mode type in mm/ioremap.c Juergen Gross
2014-10-31 14:00 ` [PATCH 12/17] x86: Use new cache mode type in memtype related functions Juergen Gross
2014-10-31 14:00 ` [PATCH 13/17] x86: Clean up pgtable_types.h Juergen Gross
2014-10-31 14:00 ` [PATCH 14/17] x86: Support PAT bit in pagetable dump for lower levels Juergen Gross
2014-10-31 14:00 ` [PATCH 15/17] x86: Respect PAT bit when copying pte values between large and normal pages Juergen Gross
2014-10-31 14:00 ` [PATCH 16/17] x86: Enable PAT to use cache mode translation tables Juergen Gross
2014-10-31 14:00 ` [PATCH 17/17] xen: Support Xen pv-domains using PAT Juergen Gross
2014-10-31 14:06 ` [PATCH 00/17] x86: Full support of PAT Ingo Molnar
2014-10-31 14:08   ` Juergen Gross
2014-10-31 18:53   ` Thomas Gleixner
2014-11-03  6:44     ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.11.1410311617260.5308@nanos \
    --to=tglx@linutronix.de \
    --cc=bhelgaas@google.com \
    --cc=david.vrabel@citrix.com \
    --cc=hpa@zytor.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=stefan.bader@canonical.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=toshi.kani@hp.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®