mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Peter Zijlstra <peterz@infradead.org>,
	Bin Yang <bin.yang@intel.com>, Mark Gross <mark.gross@intel.com>
Subject: Re: [patch 02/10] x86/mm/cpa: Rework static_protections()
Date: Fri, 7 Sep 2018 09:21:32 -0700	[thread overview]
Message-ID: <5cc869d4-ef55-3010-46be-cf5a3081c62d@intel.com> (raw)
In-Reply-To: <20180907152054.558544759@linutronix.de>

On 09/07/2018 08:01 AM, Thomas Gleixner wrote:
> +static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
> +					  unsigned long pfn)
> +{
> +	pgprotval_t forbidden;
> +
> +	/* Operate on the virtual address */
> +	forbidden  = protect_kernel_text(address);
> +	forbidden |= protect_kernel_text_ro(address);
> +
> +	/* Check the PFN directly */
> +	forbidden |= protect_pci_bios(pfn);
> +	forbidden |= protect_rodata(pfn);
>  
> -	return prot;
> +	return __pgprot(pgprot_val(prot) & ~forbidden);
>  }

Wow, that's quite an improvement, especially separating the vaddr vs.
paddr checks.

  reply	other threads:[~2018-09-07 16:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 15:01 [patch 00/10] x86/mm/cpa: Improve large page preservation handling Thomas Gleixner
2018-09-07 15:01 ` [patch 01/10] x86/mm/cpa: Split, rename and clean up try_preserve_large_page() Thomas Gleixner
2018-09-10  2:03   ` Yang, Bin
2018-09-10  7:04     ` Thomas Gleixner
2018-09-07 15:01 ` [patch 02/10] x86/mm/cpa: Rework static_protections() Thomas Gleixner
2018-09-07 16:21   ` Dave Hansen [this message]
2018-09-07 15:01 ` [patch 03/10] x86/mm/cpa: Allow range check for static protections Thomas Gleixner
2018-09-07 15:01 ` [patch 04/10] x86/mm/cpa: Add debug mechanism Thomas Gleixner
2018-09-07 15:01 ` [patch 05/10] x86/mm/cpa: Add large page preservation statistics Thomas Gleixner
2018-09-07 15:01 ` [patch 06/10] x86/mm/cpa: Avoid static protection checks on unmap Thomas Gleixner
2018-09-07 15:01 ` [patch 07/10] x86/mm/cpa: Add sanity check for existing mappings Thomas Gleixner
2018-09-07 15:01 ` [patch 08/10] x86/mm/cpa: Optimize same protection check Thomas Gleixner
2018-09-07 15:01 ` [patch 09/10] x86/mm/cpa: Do the range check early Thomas Gleixner
2018-09-07 15:01 ` [patch 10/10] x86/mm/cpa: Avoid the 4k pages check completely Thomas Gleixner

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=5cc869d4-ef55-3010-46be-cf5a3081c62d@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bin.yang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.gross@intel.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

Powered by JetHome