linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid.aziz@oracle.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Rob Gardner <rob.gardner@oracle.com>,
	davem@davemloft.net, corbet@lwn.net, arnd@arndb.de,
	akpm@linux-foundation.org, hpa@zytor.com,
	viro@zeniv.linux.org.uk, nitin.m.gupta@oracle.com,
	chris.hyser@oracle.com, tushar.n.dave@oracle.com,
	sowmini.varadhan@oracle.com, mike.kravetz@oracle.com,
	adam.buchbinder@gmail.com, minchan@kernel.org, hughd@google.com,
	kirill.shutemov@linux.intel.com, keescook@chromium.org,
	allen.pais@oracle.com, aryabinin@virtuozzo.com,
	atish.patra@oracle.com, joe@perches.com, pmladek@suse.com,
	jslaby@suse.cz, cmetcalf@mellanox.com,
	paul.gortmaker@windriver.com, jmarchan@redhat.com,
	lstoakes@gmail.com, 0x7f454c46@gmail.com, vbabka@suse.cz,
	tglx@linutronix.de, mingo@redhat.com, dan.j.williams@intel.com,
	iamjoonsoo.kim@lge.com, mgorman@techsingularity.net,
	vdavydov.dev@gmail.com, hannes@cmpxchg.org, namit@vmware.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-arch@vger.kernel.org,
	x86@kernel.org, linux-mm@kvack.org,
	Khalid Aziz <khalid@gonehiking.org>
Subject: Re: [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI)
Date: Fri, 6 Jan 2017 08:32:43 -0700	[thread overview]
Message-ID: <ac86aa55-964d-56a1-1381-c208de78b24e@oracle.com> (raw)
In-Reply-To: <20170106091934.GF5556@dhcp22.suse.cz>

On 01/06/2017 02:19 AM, Michal Hocko wrote:
> On Thu 05-01-17 13:30:10, Khalid Aziz wrote:
> [...]
>> It is very tempting to restrict tags to PAGE_SIZE granularity since it makes
>> code noticeably simpler and that is indeed going to be the majority of
>> cases. Sooner or later somebody would want to use multiple tags per page
>> though.
>
> I didn't get to read the patch throughly yet but I am really confused by
> this statement. The api is mprotect based which makes it ineherently
> PAGE_SIZE granular. How do you want to achieve cache line granularity
> with this API?
>
> And I would really vote for simplicity first... Subpage granularity
> sounds way too tricky...
>

Hi Michal,

ADI can be enabled for subsets of a task's address space. It takes three 
steps to enable ADI completely:

1. Enable the task to use ADI by setting PSTATE.mcde bit. This is the 
master switch for ADI. mprotect() does this in my patch. Granularity for 
this operation is entire address space for the task.

2. Set TTE.mcd bit for each page translation for the pages one wants ADI 
enabled on. mprotect() does this as well in my patch. Granularity for 
this operation is per page.

3. Set version tag for the addresses task wants to enable ADI on using 
"stxa" instruction. This is done entirely in userspace with no 
assistance or intervention needed from the kernel. Granularity for this 
operation is cache line size which is 64 bytes on Sparc M7.

I agree with you on simplicity first. Subpage granularity is complex, 
but the architecture allows for subpage granularity. Maybe the right 
approach is to support this at page granularity first for swappable 
pages and then expand to subpage granularity in a subsequent patch? 
Pages locked in memory can already use subpage granularity with my patch.

Thanks,
Khalid

  reply	other threads:[~2017-01-06 15:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 22:46 [RFC PATCH v3] sparc64: Add support for Application Data Integrity (ADI) Khalid Aziz
2017-01-04 23:27 ` Dave Hansen
2017-01-04 23:35   ` Rob Gardner
2017-01-04 23:40     ` Dave Hansen
2017-01-04 23:44       ` Rob Gardner
2017-01-04 23:49         ` Dave Hansen
2017-01-04 23:56           ` Rob Gardner
2017-01-04 23:58           ` Khalid Aziz
2017-01-05  0:01             ` Dave Hansen
2017-01-05  0:05               ` Rob Gardner
2017-01-05  0:14                 ` Dave Hansen
2017-01-05  0:26                   ` Khalid Aziz
2017-01-05 19:22                     ` Dave Hansen
2017-01-05 20:30                       ` Khalid Aziz
2017-01-06  9:19                         ` Michal Hocko
2017-01-06 15:32                           ` Khalid Aziz [this message]
2017-01-06 15:36                             ` Dave Hansen
2017-01-06 16:22                               ` Khalid Aziz
2017-01-06 16:25                                 ` David Miller
2017-01-06 16:55                                 ` Dave Hansen
2017-01-06 17:02                                   ` David Miller
2017-01-06 17:10                                     ` Khalid Aziz
2017-01-06 17:54                                       ` Rob Gardner
2017-01-06 18:18                                         ` Khalid Aziz
2017-01-06 18:28                                           ` Rob Gardner
2017-01-06 17:08                                   ` Khalid Aziz
2017-01-04 23:43   ` Khalid Aziz
2017-01-04 23:31 ` Dave Hansen
2017-01-04 23:46   ` Khalid Aziz
2017-01-04 23:50     ` Dave Hansen
2017-01-05  9:37 ` Jerome Marchand
2017-01-05 15:13   ` Khalid Aziz

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=ac86aa55-964d-56a1-1381-c208de78b24e@oracle.com \
    --to=khalid.aziz@oracle.com \
    --cc=0x7f454c46@gmail.com \
    --cc=adam.buchbinder@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=allen.pais@oracle.com \
    --cc=arnd@arndb.de \
    --cc=aryabinin@virtuozzo.com \
    --cc=atish.patra@oracle.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=davem@davemloft.net \
    --cc=hannes@cmpxchg.org \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jmarchan@redhat.com \
    --cc=joe@perches.com \
    --cc=jslaby@suse.cz \
    --cc=keescook@chromium.org \
    --cc=khalid@gonehiking.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=minchan@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namit@vmware.com \
    --cc=nitin.m.gupta@oracle.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=pmladek@suse.com \
    --cc=rob.gardner@oracle.com \
    --cc=sowmini.varadhan@oracle.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tushar.n.dave@oracle.com \
    --cc=vbabka@suse.cz \
    --cc=vdavydov.dev@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).