(TSTATE.mcde), turn MCD on on a memory range and set version tag
for ADI to be effective for the task. This patch adds support for
ADI for hugepages only. Addresses passed into system calls must be
non-ADI tagged addresses.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
---
NOTES: ADI is a new f
://github.com/0day-ci/linux/commits/Khalid-Aziz/sparc64-Add-support-for-Application-Data-Integrity-ADI/20160303-025709
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git master
config: sparc64-allnoconfig (attached as .config)
reproduce:
wget
https://git.kernel.org/cgit/linux
On 03/02/2016 05:48 PM, Julian Calaby wrote:
Hi Khalid,
On Thu, Mar 3, 2016 at 11:25 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
Thanks, Julian! I really appreciate your feedback.
No problem!
My comments below.
On 03/02/2016 04:08 PM, Julian Calaby wrote:
Hi Khalid,
On Thu,
On 03/07/2016 08:30 AM, Rob Gardner wrote:
On 03/07/2016 07:07 AM, Khalid Aziz wrote:
On 03/05/2016 09:07 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 2 Mar 2016 13:39:37 -0700
In this
first implementation I am enabling ADI for hugepage
On 03/07/2016 09:45 AM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 08:07:53 -0700
I can remove CONFIG_SPARC_ADI. It does mean this code will be built
into 32-bit kernels as well but it will be inactive code.
The code should be built only in
On 03/07/2016 11:08 AM, Andy Lutomirski wrote:
On Mon, Mar 7, 2016 at 10:04 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
On 03/07/2016 09:56 AM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 08:07:53 -0700
PR_GET_SPARC_ADICAPS
Put thi
On 03/07/2016 11:09 AM, Rob Gardner wrote:
On 03/07/2016 10:04 AM, Khalid Aziz wrote:
On 03/07/2016 09:56 AM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 08:07:53 -0700
PR_GET_SPARC_ADICAPS
Put this into a new ELF auxiliary vector ent
On 03/07/2016 11:49 AM, Andy Lutomirski wrote:
On Mon, Mar 7, 2016 at 10:22 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
No, it changes the tag associated with the virtual address for the caller.
Physical page backing this virtual address is unaffected. Tag checking is
done for v
On 03/07/2016 01:58 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 13:41:39 -0700
Shared data may not always be backed by a file. My understanding is
one of the use cases is for in-memory databases. This shared space
could also be used to ha
On 03/07/2016 12:16 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 11:24:54 -0700
Tags can be cleared by user by setting tag to 0. Tags are
automatically cleared by the hardware when the mapping for a virtual
address is removed from TSB (which
On 03/07/2016 08:43 AM, Andy Lutomirski wrote:
On Mon, Mar 7, 2016 at 7:30 AM, Rob Gardner <rob.gard...@oracle.com> wrote:
On 03/07/2016 07:07 AM, Khalid Aziz wrote:
On 03/05/2016 09:07 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 2 Mar 2016 13
On 03/07/2016 12:16 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 11:24:54 -0700
Tags can be cleared by user by setting tag to 0. Tags are
automatically cleared by the hardware when the mapping for a virtual
address is removed from TSB (which
On 03/08/2016 12:57 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 14:06:43 -0700
Good questions. Isn't set of valid VAs already constrained by VA_BITS
(set to 44 in arch/sparc/include/asm/processor_64.h)? As I see it we
are already not using the
On 03/08/2016 01:27 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Tue, 8 Mar 2016 13:16:11 -0700
On 03/08/2016 12:57 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Mon, 7 Mar 2016 14:06:43 -0700
Good questions. Isn't set
On 01/30/2017 03:15 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 25 Jan 2017 12:57:16 -0700
+static inline void enable_adi(void)
+{
...
+ __asm__ __volatile__(
+ "rdpr %%pstate, %%g1\n\t"
+ "
On 01/25/2017 03:50 PM, Rob Gardner wrote:
On 01/25/2017 03:20 PM, Khalid Aziz wrote:
On 01/25/2017 03:00 PM, Rob Gardner wrote:
On 01/25/2017 12:57 PM, Khalid Aziz wrote:
@@ -157,6 +158,24 @@ int __get_user_pages_fast(unsigned long start,
int nr_pages, int write,
pgd_t *pgdp
On 01/25/2017 03:00 PM, Rob Gardner wrote:
On 01/25/2017 12:57 PM, Khalid Aziz wrote:
@@ -157,6 +158,24 @@ int __get_user_pages_fast(unsigned long start,
int nr_pages, int write,
pgd_t *pgdp;
int nr = 0;
+#ifdef CONFIG_SPARC64
+if (adi_capable()) {
+long addr = start
page for the
tag to survive swap and migration. Swap swupport infrastructure in this
patch allows for this capability to be expanded to store/restore more
than one tag per page in future.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.or
ead-only to crash if it changes ADI tags without coordinating
the change with other processes.
These ideas need to be explored more before implementing a fix. There
are potential race conditions as well in the solution for second issue
that will need to be evaluated and addressed.
---
Khalid Aziz
On 01/16/2017 09:39 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 11 Jan 2017 09:12:54 -0700
+ __asm__ __volatile__(
+ ".word 0xa1438000\n\t"/* rd %mcdper, %l0 */
Just use "rd %%asr14, %0&quo
On 01/17/2017 12:42 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Tue, 17 Jan 2017 12:32:46 -0700
On 01/16/2017 09:39 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 11 Jan 2017 09:12:54 -0700
+ __asm__
On 01/16/2017 09:47 PM, David Miller wrote:
From: Dave Hansen
Date: Wed, 11 Jan 2017 10:13:54 -0800
For memory shared by two different processes, do they have to agree on
what the tags are, or can they differ?
Whoever allocates the memory (does the
On 01/16/2017 09:39 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 11 Jan 2017 09:12:54 -0700
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index 8a6982d..68b03bf 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@
page for the
tag to survive swap and migration. Swap swupport infrastructure in this
patch allows for this capability to be expanded to store/restore more
than one tag per page in future.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.or
ons as well in the solution for second issue
that will need to be evaluated and addressed.
---
Khalid Aziz (4):
signals, sparc: Add signal codes for ADI violations
mm: Add functions to support extra actions on swap in/out
sparc64: Add support for ADI register fields, ASIs and traps
sparc64:
On 01/12/2017 06:31 PM, Rob Gardner wrote:
On 01/12/2017 05:22 PM, Khalid Aziz wrote:
On 01/12/2017 10:53 AM, Dave Hansen wrote:
On 01/12/2017 08:50 AM, Khalid Aziz wrote:
2. Any shared page that has ADI protection enabled on it, must stay ADI
protected across all processes sharing
On 01/11/2017 11:13 AM, Dave Hansen wrote:
On 01/11/2017 08:56 AM, Khalid Aziz wrote:
On 01/11/2017 09:33 AM, Dave Hansen wrote:
On 01/11/2017 08:12 AM, Khalid Aziz wrote:
A userspace task enables ADI through mprotect(). This patch series adds
a page protection bit PROT_ADI
ugh multiple hour long runs of
this test.
- Tested page migration with malloc and shm by migrating data pages of
active ADI test process using migratepages, back and forth between two
nodes every few seconds over an hour long run. Verified page migration
through /proc//numa_maps.
---
Kha
On 01/12/2017 10:53 AM, Dave Hansen wrote:
On 01/12/2017 08:50 AM, Khalid Aziz wrote:
2. Any shared page that has ADI protection enabled on it, must stay ADI
protected across all processes sharing it.
Is that true?
What happens if a page with ADI tags set is accessed via a PTE without
On 01/13/2017 08:29 AM, Rob Gardner wrote:
On 01/13/2017 07:48 AM, Khalid Aziz wrote:
On 01/12/2017 06:31 PM, Rob Gardner wrote:
On 01/12/2017 05:22 PM, Khalid Aziz wrote:
On 01/12/2017 10:53 AM, Dave Hansen wrote:
On 01/12/2017 08:50 AM, Khalid Aziz wrote:
2. Any shared page that has ADI
page for the
tag to survive swap and migration. Swap swupport infrastructure in this
patch allows for this capability to be expanded to store/restore more
than one tag per page in future.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.or
On 01/11/2017 12:11 PM, Dave Hansen wrote:
On 01/11/2017 10:50 AM, Khalid Aziz wrote:
On 01/11/2017 11:13 AM, Dave Hansen wrote:
On 01/11/2017 08:56 AM, Khalid Aziz wrote:
For memory shared by two different processes, do they have to agree on
what the tags are, or can they differ?
The two
On 01/05/2017 02:37 AM, Jerome Marchand wrote:
On 01/04/2017 11:46 PM, Khalid Aziz wrote:
ADI is a new feature supported on sparc M7 and newer processors to allow
hardware to catch rogue accesses to memory. ADI is supported for data
fetches only and not instruction fetches. An app can enable
On 01/05/2017 12:22 PM, Dave Hansen wrote:
On 01/04/2017 04:26 PM, Khalid Aziz wrote:
...
No, we do not have space to stuff PAGE_SIZE/64 version tags in swap pte.
There is enough space for just one tag per page. DaveM had suggested
doing this since the usual case is for a task to set one tag
On 01/06/2017 10:02 AM, David Miller wrote:
From: Dave Hansen
Date: Fri, 6 Jan 2017 08:55:03 -0800
Actually, that reminds me... How does your code interface with ksm? Or
is there no interaction needed since you're always working on virtual
addresses?
This
On 01/06/2017 10:54 AM, Rob Gardner wrote:
On 01/06/2017 09:10 AM, Khalid Aziz wrote:
On 01/06/2017 10:02 AM, David Miller wrote:
From: Dave Hansen <dave.han...@linux.intel.com>
Date: Fri, 6 Jan 2017 08:55:03 -0800
Actually, that reminds me... How does your code interface wi
On 01/06/2017 09:55 AM, Dave Hansen wrote:
On 01/06/2017 08:22 AM, Khalid Aziz wrote:
On 01/06/2017 08:36 AM, Dave Hansen wrote:
On 01/06/2017 07:32 AM, Khalid Aziz wrote:
I agree with you on simplicity first. Subpage granularity is complex,
but the architecture allows for subpage granularity
On 01/04/2017 04:49 PM, Dave Hansen wrote:
On 01/04/2017 03:44 PM, Rob Gardner wrote:
On 01/04/2017 03:40 PM, Dave Hansen wrote:
On 01/04/2017 03:35 PM, Rob Gardner wrote:
Tags are not cleared at all when memory is freed, but rather, lazily
(and automatically) cleared when memory is
On 01/04/2017 04:31 PM, Dave Hansen wrote:
One other high-level comment: It would be nice to see the
arch-independent and x86 portions broken out and explained in their own
right, even if they're small patches. It's a bit cruel to make us
scroll through a thousand lines of sparc code to see
must
explicitly enable ADI on a memory range and set version tag for ADI to
be effective for the task.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.org>
---
v2:
- Fixed a build error
v3:
- Removed CONFIG_SPARC_ADI
- Re
On 01/04/2017 04:27 PM, Dave Hansen wrote:
On 01/04/2017 02:46 PM, Khalid Aziz wrote:
This patch extends mprotect to enable ADI (TSTATE.mcde), enable/disable
MCD (Memory Corruption Detection) on selected memory ranges, enable
TTE.mcd in PTEs, return ADI parameters to userspace and save/restore
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
On 01/06/2017 08:36 AM, Dave Hansen wrote:
On 01/06/2017 07:32 AM, Khalid Aziz wrote:
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
On 03/06/2017 05:13 PM, Anthony Yznaga wrote:
On Feb 28, 2017, at 10:35 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
diff --git a/arch/sparc/kernel/etrap_64.S b/arch/sparc/kernel/etrap_64.S
index 1276ca2..7be33bf 100644
--- a/arch/sparc/kernel/etrap_64.S
+++ b/arch/sparc/kernel/etra
On 08/15/2017 10:58 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 9 Aug 2017 15:26:02 -0600
+void adi_restore_tags(struct mm_struct *mm, struct vm_area_struct *vma,
+ unsigned long addr, pte_t pte)
+{
...
+ tag = tag_star
for any task. A task must explicitly enable ADI on a memory
range and set version tag for ADI to be effective for the task.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.org>
---
v7:
- Enhanced arch_validate_prot() to enable ADI only
Verified page migration
through /proc//numa_maps.
- Tested COW support using test that forks children that read from
ADI enabled pages shared with parent and other children and write to
them as well forcing COW.
-
Khalid Aziz (9):
signals, sparc: Add signal codes for ADI vio
On 10/13/2017 08:14 AM, Khalid Aziz wrote:
On 10/12/2017 02:27 PM, Anthony Yznaga wrote:
On Oct 12, 2017, at 7:44 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
On 10/06/2017 04:12 PM, Anthony Yznaga wrote:
On Sep 25, 2017, at 9:49 AM, Khalid Aziz <khalid.a...@oracle.co
On 10/12/2017 02:27 PM, Anthony Yznaga wrote:
On Oct 12, 2017, at 7:44 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
On 10/06/2017 04:12 PM, Anthony Yznaga wrote:
On Sep 25, 2017, at 9:49 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
This patch extends mprotect t
Hi Anthony,
Please quote only the relevant parts of the patch with comments. That
makes it much easier to find the comments.
On 10/06/2017 04:12 PM, Anthony Yznaga wrote:
On Sep 25, 2017, at 9:49 AM, Khalid Aziz <khalid.a...@oracle.com> wrote:
This patch extends mprotect to enab
On 08/30/2017 04:38 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 30 Aug 2017 16:27:54 -0600
+#define arch_calc_vm_prot_bits(prot, pkey)
sparc_calc_vm_prot_bits(prot)
+static inline unsigned long sparc_calc_vm_prot_bits(unsigned long
prot)
+{
+ if
On 09/04/2017 10:25 AM, Pavel Machek wrote:
Hi!
ADI is a new feature supported on SPARC M7 and newer processors to allow
hardware to catch rogue accesses to memory. ADI is supported for data
fetches only and not instruction fetches. An app can enable ADI on its
data pages, set version tags on
ldren and write to
them as well forcing COW.
-
Khalid Aziz (9):
signals, sparc: Add signal codes for ADI violations
mm, swap: Add infrastructure for saving page metadata as well on swap
sparc64: Add support for ADI register fields, ASIs and traps
sparc64: Add HV fault type handlers
for any task. A task must explicitly enable ADI on a memory
range and set version tag for ADI to be effective for the task.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.org>
---
v8:
- Added note to doc about non-faulting loads no
On 08/30/2017 06:09 PM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Wed, 30 Aug 2017 17:23:37 -0600
That is an interesting idea. This would enable TSTATE_MCDE on all
threads of a process as soon as one thread enables it. If we consider
the case where the parent c
wo
nodes every few seconds over an hour long run. Verified page migration
through /proc//numa_maps.
- Tested COW support using test that forks children that read from
ADI enabled pages shared with parent and other children and write to
them as well forcing COW.
-
Khalid Aziz (10):
for any task. A task must explicitly enable ADI on a memory
range and set version tag for ADI to be effective for the task.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.org>
---
v10:
- Added code to return from kernel path to set
for any task. A task must explicitly enable ADI on a memory
range and set version tag for ADI to be effective for the task.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.org>
---
v9:
- Added code to migrate ADI tags to c
ite to
them as well forcing COW.
-
Khalid Aziz (10):
signals, sparc: Add signal codes for ADI violations
mm, swap: Add infrastructure for saving page metadata as well on swap
sparc64: Add support for ADI register fields, ASIs and traps
sparc64: Add HV fault type handlers for ADI rela
On 02/01/2018 07:29 PM, ebied...@xmission.com wrote:
Khalid Aziz <khalid.a...@oracle.com> writes:
V11 changes:
This series is same as v10 and was simply rebased on 4.15 kernel. Can
mm maintainers please review patches 2, 7, 8 and 9 which are arch
independent, and include/linux/mm.h
een two
nodes every few seconds over an hour long run. Verified page migration
through /proc//numa_maps.
- Tested COW support using test that forks children that read from
ADI enabled pages shared with parent and other children and write to
them as well forcing COW.
-
Khalid Aziz (
for any task. A task must explicitly enable ADI on a memory
range and set version tag for ADI to be effective for the task.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.org>
Reviewed-by: Anthony Yznaga <anthony.yzn...@oracle.com>
---
v1
On 02/07/2018 12:38 AM, ebied...@xmission.com wrote:
Khalid Aziz <khalid.a...@oracle.com> writes:
On 02/01/2018 07:29 PM, ebied...@xmission.com wrote:
Khalid Aziz <khalid.a...@oracle.com> writes:
V11 changes:
This series is same as v10 and was simply rebased on 4.15 ke
On 02/23/2018 11:57 AM, David Miller wrote:
From: Khalid Aziz <khalid.a...@oracle.com>
Date: Fri, 23 Feb 2018 11:51:25 -0700
On 02/22/2018 07:50 PM, kbuild test robot wrote:
Hi Khalid,
I love your patch! Yet something to improve:
[auto build test ERROR on sparc-next/master]
[also buil
to help
improve the system]
url:
https://github.com/0day-ci/linux/commits/Khalid-Aziz/Application-Data-Integrity-feature-introduced-by-SPARC-M7/20180223-071725
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next.git
master
config: sparc64-allyesconfig (attached as .config
children that read from
ADI enabled pages shared with parent and other children and write to
them as well forcing COW.
-
Khalid Aziz (11):
signals, sparc: Add signal codes for ADI violations
mm, swap: Add infrastructure for saving page metadata on swap
sparc64: Add support for AD
for any task. A task must explicitly enable ADI on a memory
range and set version tag for ADI to be effective for the task.
Signed-off-by: Khalid Aziz <khalid.a...@oracle.com>
Cc: Khalid Aziz <kha...@gonehiking.org>
Reviewed-by: Anthony Yznaga <anthony.yzn...@oracle.com>
---
v1
On 03/18/2018 09:08 AM, David Miller wrote:
In uapi/asm/auxvec.h you conditionalize the ADI aux vectors on
CONFIG_SPARC64.
That's not correct, you should never control user facing definitions
based upon kernel configuration.
Also, both 32-bit and 64-bit applications running on ADI capable
On 03/05/2018 12:22 PM, Dave Hansen wrote:
On 02/21/2018 09:15 AM, Khalid Aziz wrote:
+#define arch_validate_prot(prot, addr) sparc_validate_prot(prot, addr)
+static inline int sparc_validate_prot(unsigned long prot, unsigned long addr)
+{
+ if (prot & ~(PROT_READ | PROT_WRITE | PROT_
On 03/05/2018 02:26 PM, Dave Hansen wrote:
On 02/21/2018 09:15 AM, Khalid Aziz wrote:
+tag_storage_desc_t *alloc_tag_store(struct mm_struct *mm,
+ struct vm_area_struct *vma,
+ unsigned long addr)
...
+ tags = kzalloc
On 03/05/2018 02:31 PM, Dave Hansen wrote:
On 03/05/2018 01:14 PM, Khalid Aziz wrote:
Are you suggesting that vma returned by find_vma() could be split or
merged underneath me if I do not hold mmap_sem and thus make the flag
check invalid? If so, that is a good point.
This part does make me
71 matches
Mail list logo