All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: khalid.aziz@oracle.com
Cc: corbet@lwn.net, viro@zeniv.linux.org.uk,
	nitin.m.gupta@oracle.com, mike.kravetz@oracle.com,
	akpm@linux-foundation.org, mingo@kernel.org,
	kirill.shutemov@linux.intel.com, adam.buchbinder@gmail.com,
	hughd@google.com, minchan@kernel.org, keescook@chromium.org,
	chris.hyser@oracle.com, atish.patra@oracle.com,
	cmetcalf@mellanox.com, atomlin@redhat.com, jslaby@suse.cz,
	joe@perches.com, paul.gortmaker@windriver.com, mhocko@suse.com,
	lstoakes@gmail.com, jack@suse.cz, dave.hansen@linux.intel.com,
	vbabka@suse.cz, dan.j.williams@intel.com, iamjoonsoo.kim@lge.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	khalid@gonehiking.org
Subject: Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)
Date: Wed, 01 Feb 2017 12:18:32 -0500 (EST)	[thread overview]
Message-ID: <20170201.121832.1810577893703014061.davem@davemloft.net> (raw)
In-Reply-To: <6c514e7e-338a-f1cd-140d-d4980ea6ac0f@oracle.com>

From: Khalid Aziz <khalid.aziz@oracle.com>
Date: Tue, 31 Jan 2017 16:38:49 -0700

> Thanks for the feedback. This is very helpful. I checked and it indeed
> can cost 50+ cycles even on M7 processor for PSTATE accesses.

Consider how many bytes can be copied in 50+ cycles :-)

>> On etrap, you change ESTATE_PSTATE{1,2} to have the MCDE bit enabled.
>> Then the kernel always runs with ADI enabled.
> 
> Running the kernel with PSTATE.mcde=1 can possibly be problematic as
> we had discussed earlier in this thread where keeping PSTATE.mcde
> enabled might mean kernel having to keep track of which pages still
> have tags set on them or flush tags on every page on free. I will go
> through the code again to see if it PSTATE.mcde can be turned on in
> kernel all the time, which might be the case if we can ensure kernel
> accesses pages with TTE.mcd cleared.

If we can clear the tags properly on page release when the page was
used for ADI, it can work.

One way would be to track the state in the page struct somehow, and
in arch_alloc_page() clear the tags if necessary.

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: khalid.aziz@oracle.com
Cc: corbet@lwn.net, viro@zeniv.linux.org.uk,
	nitin.m.gupta@oracle.com, mike.kravetz@oracle.com,
	akpm@linux-foundation.org, mingo@kernel.org,
	kirill.shutemov@linux.intel.com, adam.buchbinder@gmail.com,
	hughd@google.com, minchan@kernel.org, keescook@chromium.org,
	chris.hyser@oracle.com, atish.patra@oracle.com,
	cmetcalf@mellanox.com, atomlin@redhat.com, jslaby@suse.cz,
	joe@perches.com, paul.gortmaker@windriver.com, mhocko@suse.com,
	lstoakes@gmail.com, jack@suse.cz, dave.hansen@linux.intel.com,
	vbabka@suse.cz, dan.j.williams@intel.com, iamjoonsoo.kim@lge.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	khalid@gonehiking.org
Subject: Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)
Date: Wed, 01 Feb 2017 17:18:32 +0000	[thread overview]
Message-ID: <20170201.121832.1810577893703014061.davem@davemloft.net> (raw)
In-Reply-To: <6c514e7e-338a-f1cd-140d-d4980ea6ac0f@oracle.com>

From: Khalid Aziz <khalid.aziz@oracle.com>
Date: Tue, 31 Jan 2017 16:38:49 -0700

> Thanks for the feedback. This is very helpful. I checked and it indeed
> can cost 50+ cycles even on M7 processor for PSTATE accesses.

Consider how many bytes can be copied in 50+ cycles :-)

>> On etrap, you change ESTATE_PSTATE{1,2} to have the MCDE bit enabled.
>> Then the kernel always runs with ADI enabled.
> 
> Running the kernel with PSTATE.mcde=1 can possibly be problematic as
> we had discussed earlier in this thread where keeping PSTATE.mcde
> enabled might mean kernel having to keep track of which pages still
> have tags set on them or flush tags on every page on free. I will go
> through the code again to see if it PSTATE.mcde can be turned on in
> kernel all the time, which might be the case if we can ensure kernel
> accesses pages with TTE.mcd cleared.

If we can clear the tags properly on page release when the page was
used for ADI, it can work.

One way would be to track the state in the page struct somehow, and
in arch_alloc_page() clear the tags if necessary.

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: khalid.aziz@oracle.com
Cc: corbet@lwn.net, viro@zeniv.linux.org.uk,
	nitin.m.gupta@oracle.com, mike.kravetz@oracle.com,
	akpm@linux-foundation.org, mingo@kernel.org,
	kirill.shutemov@linux.intel.com, adam.buchbinder@gmail.com,
	hughd@google.com, minchan@kernel.org, keescook@chromium.org,
	chris.hyser@oracle.com, atish.patra@oracle.com,
	cmetcalf@mellanox.com, atomlin@redhat.com, jslaby@suse.cz,
	joe@perches.com, paul.gortmaker@windriver.com, mhocko@suse.com,
	lstoakes@gmail.com, jack@suse.cz, dave.hansen@linux.intel.com,
	vbabka@suse.cz, dan.j.williams@intel.com, iamjoonsoo.kim@lge.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	khalid@gonehiking.org
Subject: Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)
Date: Wed, 01 Feb 2017 12:18:32 -0500 (EST)	[thread overview]
Message-ID: <20170201.121832.1810577893703014061.davem@davemloft.net> (raw)
In-Reply-To: <6c514e7e-338a-f1cd-140d-d4980ea6ac0f@oracle.com>

From: Khalid Aziz <khalid.aziz@oracle.com>
Date: Tue, 31 Jan 2017 16:38:49 -0700

> Thanks for the feedback. This is very helpful. I checked and it indeed
> can cost 50+ cycles even on M7 processor for PSTATE accesses.

Consider how many bytes can be copied in 50+ cycles :-)

>> On etrap, you change ESTATE_PSTATE{1,2} to have the MCDE bit enabled.
>> Then the kernel always runs with ADI enabled.
> 
> Running the kernel with PSTATE.mcde=1 can possibly be problematic as
> we had discussed earlier in this thread where keeping PSTATE.mcde
> enabled might mean kernel having to keep track of which pages still
> have tags set on them or flush tags on every page on free. I will go
> through the code again to see if it PSTATE.mcde can be turned on in
> kernel all the time, which might be the case if we can ensure kernel
> accesses pages with TTE.mcd cleared.

If we can clear the tags properly on page release when the page was
used for ADI, it can work.

One way would be to track the state in the page struct somehow, and
in arch_alloc_page() clear the tags if necessary.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-02-01 17:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 19:57 [PATCH v5 0/4] Application Data Integrity feature introduced by SPARC M7 Khalid Aziz
2017-01-25 19:57 ` Khalid Aziz
2017-01-25 19:57 ` Khalid Aziz
2017-01-25 19:57 ` Khalid Aziz
2017-01-25 19:57 ` [PATCH v5 1/4] signals, sparc: Add signal codes for ADI violations Khalid Aziz
2017-01-25 19:57   ` Khalid Aziz
2017-01-25 19:57 ` [PATCH v5 2/4] mm: Add functions to support extra actions on swap in/out Khalid Aziz
2017-01-25 19:57   ` Khalid Aziz
2017-01-25 19:57   ` Khalid Aziz
2017-01-25 19:57 ` [PATCH v5 3/4] sparc64: Add support for ADI register fields, ASIs and traps Khalid Aziz
2017-01-25 19:57   ` Khalid Aziz
2017-01-25 19:57 ` [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity) Khalid Aziz
2017-01-25 19:57   ` Khalid Aziz
2017-01-25 19:57   ` Khalid Aziz
2017-01-25 22:00   ` Rob Gardner
2017-01-25 22:00     ` Rob Gardner
2017-01-25 22:00     ` Rob Gardner
2017-01-25 22:13     ` David Miller
2017-01-25 22:13       ` David Miller
2017-01-25 22:13       ` David Miller
2017-01-25 22:20     ` Khalid Aziz
2017-01-25 22:20       ` Khalid Aziz
2017-01-25 22:20       ` Khalid Aziz
2017-01-25 22:50       ` Rob Gardner
2017-01-25 22:50         ` Rob Gardner
2017-01-25 22:50         ` Rob Gardner
2017-01-25 22:57         ` Khalid Aziz
2017-01-25 22:57           ` Khalid Aziz
2017-01-25 22:57           ` Khalid Aziz
2017-01-30 22:15   ` David Miller
2017-01-30 22:15     ` David Miller
2017-01-30 22:15     ` David Miller
2017-01-31 23:38     ` Khalid Aziz
2017-01-31 23:38       ` Khalid Aziz
2017-01-31 23:38       ` Khalid Aziz
2017-02-01 17:18       ` David Miller [this message]
2017-02-01 17:18         ` David Miller
2017-02-01 17:18         ` David Miller

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=20170201.121832.1810577893703014061.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=adam.buchbinder@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=atish.patra@oracle.com \
    --cc=atomlin@redhat.com \
    --cc=chris.hyser@oracle.com \
    --cc=cmetcalf@mellanox.com \
    --cc=corbet@lwn.net \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jack@suse.cz \
    --cc=joe@perches.com \
    --cc=jslaby@suse.cz \
    --cc=keescook@chromium.org \
    --cc=khalid.aziz@oracle.com \
    --cc=khalid@gonehiking.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=nitin.m.gupta@oracle.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=vbabka@suse.cz \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.