Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Khalid Aziz
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

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Khalid Aziz
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

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
On 03/05/2018 01:37 PM, Khalid Aziz wrote: >> How big can this storage get, btw?  Superficially it seems like it might >> be able to be gigantic for a large, sparse VMA. >> > Tags are stored only for the pages being swapped out, not for the pages > in entire vma. Each tag storage page can hold

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
On 03/05/2018 01:37 PM, Khalid Aziz wrote: >> How big can this storage get, btw?  Superficially it seems like it might >> be able to be gigantic for a large, sparse VMA. >> > Tags are stored only for the pages being swapped out, not for the pages > in entire vma. Each tag storage page can hold

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Khalid Aziz
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 =

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Khalid Aziz
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 =

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
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 think that this code hasn't been tested

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
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 think that this code hasn't been tested

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
On 03/05/2018 01:14 PM, Khalid Aziz wrote: > 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)

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
On 03/05/2018 01:14 PM, Khalid Aziz wrote: > 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)

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
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(size, GFP_NOWAIT|__GFP_NOWARN); > + if

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
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(size, GFP_NOWAIT|__GFP_NOWARN); > + if

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Khalid Aziz
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_EXEC

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Khalid Aziz
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_EXEC

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
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_EXEC | PROT_SEM | PROT_ADI)) > +

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-03-05 Thread Dave Hansen
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_EXEC | PROT_SEM | PROT_ADI)) > +

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-23 Thread Khalid Aziz
On 02/23/2018 11:57 AM, David Miller wrote: From: Khalid Aziz 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 build test

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-23 Thread Khalid Aziz
On 02/23/2018 11:57 AM, David Miller wrote: From: Khalid Aziz 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 build test ERROR on v4.16-rc2]

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-23 Thread Khalid Aziz
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 build test ERROR on v4.16-rc2] [cannot apply to next-20180222] [if your patch is applied to the wrong git tree, please drop us a note to

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-23 Thread Khalid Aziz
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 build test ERROR on v4.16-rc2] [cannot apply to next-20180222] [if your patch is applied to the wrong git tree, please drop us a note to

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-23 Thread David Miller
From: Khalid Aziz 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 build test ERROR on v4.16-rc2] >> [cannot

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-23 Thread David Miller
From: Khalid Aziz 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 build test ERROR on v4.16-rc2] >> [cannot apply to next-20180222] >>

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-22 Thread kbuild test robot
Hi Khalid, I love your patch! Yet something to improve: [auto build test ERROR on sparc-next/master] [also build test ERROR on v4.16-rc2] [cannot apply to next-20180222] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-22 Thread kbuild test robot
Hi Khalid, I love your patch! Yet something to improve: [auto build test ERROR on sparc-next/master] [also build test ERROR on v4.16-rc2] [cannot apply to next-20180222] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-21 Thread Khalid Aziz
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 them and use versioned addresses to access the data

[PATCH v12 10/11] sparc64: Add support for ADI (Application Data Integrity)

2018-02-21 Thread Khalid Aziz
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 them and use versioned addresses to access the data