public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel•com>
To: Ram Pai <linuxram@us•ibm.com>
Cc: Thomas Gleixner <tglx@linutronix•de>,
	mingo@redhat•com, mpe@ellerman•id.au,
	linuxppc-dev@lists•ozlabs.org, linux-mm@kvack•org,
	x86@kernel•org, linux-arch@vger•kernel.org,
	linux-kernel@vger•kernel.org, akpm@linux-foundation•org,
	benh@kernel•crashing.org, paulus@samba•org,
	khandual@linux•vnet.ibm.com, aneesh.kumar@linux•vnet.ibm.com,
	bsingharora@gmail•com, hbabu@us•ibm.com, mhocko@kernel•org,
	bauerman@linux•vnet.ibm.com, ebiederm@xmission•com,
	corbet@lwn•net, arnd@arndb•de, fweimer@redhat•com,
	msuchanek@suse•com, Ulrich.Weigand@de•ibm.com
Subject: Re: [PATCH v3] x86: treat pkey-0 special
Date: Thu, 15 Mar 2018 10:31:51 -0700	[thread overview]
Message-ID: <2bf8e659-5a8d-a2d5-ea52-e4d395ea2201@intel.com> (raw)
In-Reply-To: <20180315172129.GD1060@ram.oc3035372033.ibm.com>

On 03/15/2018 10:21 AM, Ram Pai wrote:
> On Thu, Mar 15, 2018 at 08:55:31AM -0700, Dave Hansen wrote:
>> On 03/15/2018 02:46 AM, Thomas Gleixner wrote:
>>>> +	if (!pkey || !mm_pkey_is_allocated(mm, pkey))
>>> Why this extra check? mm_pkey_is_allocated(mm, 0) should not return true
>>> ever. If it does, then this wants to be fixed.
>> I was thinking that we _do_ actually want it to seem allocated.  It just
>> get "allocated" implicitly when an mm is created.  I think that will
>> simplify the code if we avoid treating it specially in as many places as
>> possible.
> I think, the logic that makes pkey-0 special must to go
> in arch-neutral code.   How about checking for pkey-0 in sys_pkey_free()
> itself?

This is for protection against shooting yourself in the foot?  Yes, that
can go in sys_pkey_free().

Does this need manpage and/or selftests updates?

  reply	other threads:[~2018-03-15 17:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 21:00 [PATCH v3] x86: treat pkey-0 special Ram Pai
2018-03-15  9:46 ` Thomas Gleixner
2018-03-15 15:55   ` Dave Hansen
2018-03-15 16:13     ` Thomas Gleixner
2018-03-15 17:21     ` Ram Pai
2018-03-15 17:31       ` Dave Hansen [this message]
2018-03-15 17:39         ` Ram Pai

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=2bf8e659-5a8d-a2d5-ea52-e4d395ea2201@intel.com \
    --to=dave.hansen@intel$(echo .)com \
    --cc=Ulrich.Weigand@de$(echo .)ibm.com \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=aneesh.kumar@linux$(echo .)vnet.ibm.com \
    --cc=arnd@arndb$(echo .)de \
    --cc=bauerman@linux$(echo .)vnet.ibm.com \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=bsingharora@gmail$(echo .)com \
    --cc=corbet@lwn$(echo .)net \
    --cc=ebiederm@xmission$(echo .)com \
    --cc=fweimer@redhat$(echo .)com \
    --cc=hbabu@us$(echo .)ibm.com \
    --cc=khandual@linux$(echo .)vnet.ibm.com \
    --cc=linux-arch@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mm@kvack$(echo .)org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=linuxram@us$(echo .)ibm.com \
    --cc=mhocko@kernel$(echo .)org \
    --cc=mingo@redhat$(echo .)com \
    --cc=mpe@ellerman$(echo .)id.au \
    --cc=msuchanek@suse$(echo .)com \
    --cc=paulus@samba$(echo .)org \
    --cc=tglx@linutronix$(echo .)de \
    --cc=x86@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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