[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac86aa55-964d-56a1-1381-c208de78b24e@oracle.com>
Date: Fri, 6 Jan 2017 08:32:43 -0700
From: Khalid Aziz <khalid.aziz@...cle.com>
To: Michal Hocko <mhocko@...nel.org>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
Rob Gardner <rob.gardner@...cle.com>, davem@...emloft.net,
corbet@....net, arnd@...db.de, akpm@...ux-foundation.org,
hpa@...or.com, viro@...iv.linux.org.uk, nitin.m.gupta@...cle.com,
chris.hyser@...cle.com, tushar.n.dave@...cle.com,
sowmini.varadhan@...cle.com, mike.kravetz@...cle.com,
adam.buchbinder@...il.com, minchan@...nel.org, hughd@...gle.com,
kirill.shutemov@...ux.intel.com, keescook@...omium.org,
allen.pais@...cle.com, aryabinin@...tuozzo.com,
atish.patra@...cle.com, joe@...ches.com, pmladek@...e.com,
jslaby@...e.cz, cmetcalf@...lanox.com,
paul.gortmaker@...driver.com, jmarchan@...hat.com,
lstoakes@...il.com, 0x7f454c46@...il.com, vbabka@...e.cz,
tglx@...utronix.de, mingo@...hat.com, dan.j.williams@...el.com,
iamjoonsoo.kim@....com, mgorman@...hsingularity.net,
vdavydov.dev@...il.com, hannes@...xchg.org, namit@...are.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
sparclinux@...r.kernel.org, linux-arch@...r.kernel.org,
x86@...nel.org, linux-mm@...ck.org,
Khalid Aziz <khalid@...ehiking.org>
Subject: Re: [RFC PATCH v3] sparc64: Add support for Application Data
Integrity (ADI)
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
Powered by blists - more mailing lists