Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-02-01 Thread David Miller
From: Khalid Aziz 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

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-02-01 Thread David Miller
From: Khalid Aziz 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

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-31 Thread Khalid Aziz
On 01/30/2017 03:15 PM, David Miller wrote: From: Khalid Aziz Date: Wed, 25 Jan 2017 12:57:16 -0700 +static inline void enable_adi(void) +{ ... + __asm__ __volatile__( + "rdpr %%pstate, %%g1\n\t" + "or %%g1, %0, %%g1\n\t" +

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-31 Thread Khalid Aziz
On 01/30/2017 03:15 PM, David Miller wrote: From: Khalid Aziz Date: Wed, 25 Jan 2017 12:57:16 -0700 +static inline void enable_adi(void) +{ ... + __asm__ __volatile__( + "rdpr %%pstate, %%g1\n\t" + "or %%g1, %0, %%g1\n\t" + "wrpr %%g1, %%g0,

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-30 Thread David Miller
From: Khalid Aziz Date: Wed, 25 Jan 2017 12:57:16 -0700 > +static inline void enable_adi(void) > +{ ... > + __asm__ __volatile__( > + "rdpr %%pstate, %%g1\n\t" > + "or %%g1, %0, %%g1\n\t" > + "wrpr %%g1, %%g0, %%pstate\n\t" > +

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-30 Thread David Miller
From: Khalid Aziz Date: Wed, 25 Jan 2017 12:57:16 -0700 > +static inline void enable_adi(void) > +{ ... > + __asm__ __volatile__( > + "rdpr %%pstate, %%g1\n\t" > + "or %%g1, %0, %%g1\n\t" > + "wrpr %%g1, %%g0, %%pstate\n\t" > + ".word

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Khalid Aziz
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;

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Khalid Aziz
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;

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Rob Gardner
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; int nr = 0; +#ifdef CONFIG_SPARC64 +if

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Rob Gardner
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; int nr = 0; +#ifdef CONFIG_SPARC64 +if

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Khalid Aziz
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;

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Khalid Aziz
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;

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread David Miller
From: Rob Gardner Date: Wed, 25 Jan 2017 15:00:42 -0700 > Same comment here, and the various other places that employ this same > code construct. Please do not quote an entire huge patch just to comment on a small part of it. Quote only the minimum necessary context in

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread David Miller
From: Rob Gardner Date: Wed, 25 Jan 2017 15:00:42 -0700 > Same comment here, and the various other places that employ this same > code construct. Please do not quote an entire huge patch just to comment on a small part of it. Quote only the minimum necessary context in order to provide your

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Rob Gardner
On 01/25/2017 12:57 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 ADI on its data pages, set version tags on them

Re: [PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 Thread Rob Gardner
On 01/25/2017 12:57 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 ADI on its data pages, set version tags on them

[PATCH v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 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 v5 4/4] sparc64: Add support for ADI (Application Data Integrity)

2017-01-25 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