All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] x86/pkeys: update PKRU to enable pkey 0 before
@ 2024-04-25 18:05 Aruna Ramakrishna
  2024-04-25 18:05 ` [PATCH v3 1/4] x86/pkeys: Signal handling function interface changes to accept PKRU as a parameter Aruna Ramakrishna
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Aruna Ramakrishna @ 2024-04-25 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: x86, dave.hansen, tglx, mingo, keith.lucas, aruna.ramakrishna

This version incorporates feedback from Ingo Molnar and Dave Hansen,
and adds a few test cases that exercise this flow.

v3 updates:
- Split the original patch into 3:
	- function interface changes
	- helper functions
	- functional change to write pkru on sigframe
- Enable all pkeys before XSAVE - i.e. wrpkru(0), rather than assuming
that the alt sig stack is always protected by pkey 0.
- Add a few test cases in pkey_sighandler_tests.c.

I had some trouble adding these tests to
tools/testing/selftests/mm/protection_keys.c, so they're in a separate
file.

Aruna Ramakrishna (4):
  x86/pkeys: Signal handling function interface changes to accept PKRU
    as a parameter
  x86/pkeys: Add helper functions to update PKRU on sigframe
  x86/pkeys: Update PKRU to enable all pkeys before XSAVE
  selftests/mm: Add new testcases for pkeys

 arch/x86/include/asm/fpu/signal.h             |   3 +-
 arch/x86/include/asm/sighandling.h            |  10 +-
 arch/x86/kernel/fpu/signal.c                  |  45 ++-
 arch/x86/kernel/fpu/xstate.c                  |  13 +
 arch/x86/kernel/fpu/xstate.h                  |   1 +
 arch/x86/kernel/signal.c                      |  33 +-
 arch/x86/kernel/signal_32.c                   |   8 +-
 arch/x86/kernel/signal_64.c                   |   9 +-
 tools/testing/selftests/mm/Makefile           |   2 +
 tools/testing/selftests/mm/pkey-helpers.h     |  11 +-
 .../selftests/mm/pkey_sighandler_tests.c      | 315 ++++++++++++++++++
 tools/testing/selftests/mm/protection_keys.c  |  10 -
 12 files changed, 422 insertions(+), 38 deletions(-)
 create mode 100644 tools/testing/selftests/mm/pkey_sighandler_tests.c

-- 
2.39.3


^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [PATCH v3 4/4] selftests/mm: Add new testcases for pkeys
  2024-04-25 18:05 ` [PATCH v3 4/4] selftests/mm: Add new testcases for pkeys Aruna Ramakrishna
@ 2024-05-07  3:17 ` kernel test robot
  0 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2024-04-27  4:07 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240425180542.1042933-5-aruna.ramakrishna@oracle.com>
References: <20240425180542.1042933-5-aruna.ramakrishna@oracle.com>
TO: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
TO: linux-kernel@vger.kernel.org
CC: x86@kernel.org
CC: dave.hansen@linux.intel.com
CC: tglx@linutronix.de
CC: mingo@kernel.org
CC: keith.lucas@oracle.com
CC: aruna.ramakrishna@oracle.com

Hi Aruna,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/x86/core]
[also build test ERROR on akpm-mm/mm-everything tip/master linus/master v6.9-rc5]
[cannot apply to tip/auto-latest next-20240426]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Aruna-Ramakrishna/x86-pkeys-Signal-handling-function-interface-changes-to-accept-PKRU-as-a-parameter/20240426-020800
base:   tip/x86/core
patch link:    https://lore.kernel.org/r/20240425180542.1042933-5-aruna.ramakrishna%40oracle.com
patch subject: [PATCH v3 4/4] selftests/mm: Add new testcases for pkeys
:::::: branch date: 34 hours ago
:::::: commit date: 34 hours ago
compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240427/202404271128.ERrCledH-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202404271128.ERrCledH-lkp@intel.com/

All errors (new ones prefixed by >>):

>> pkey_sighandler_tests.c:41:16: error: couldn't allocate input reg for constraint '{r10}'
      41 |         asm volatile ("syscall"
         |                       ^
>> pkey_sighandler_tests.c:41:16: error: couldn't allocate input reg for constraint '{r10}'
>> pkey_sighandler_tests.c:41:16: error: couldn't allocate input reg for constraint '{r10}'
>> pkey_sighandler_tests.c:41:16: error: couldn't allocate input reg for constraint '{r10}'
>> pkey_sighandler_tests.c:41:16: error: couldn't allocate input reg for constraint '{r10}'
   5 errors generated.


vim +41 tools/testing/selftests/mm/pkey_sighandler_tests.c

6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  33  
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  34  static inline __attribute__((always_inline)) long
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  35  syscall_raw(long n, long a1, long a2, long a3, long a4, long a5, long a6)
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  36  {
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  37  	unsigned long ret;
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  38  	register long r10 asm("r10") = a4;
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  39  	register long r8 asm("r8") = a5;
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  40  	register long r9 asm("r9") = a6;
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25 @41  	asm volatile ("syscall"
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  42  		      : "=a"(ret)
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  43  		      : "a"(n), "D"(a1), "S"(a2), "d"(a3), "r"(r10), "r"(r8), "r"(r9)
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  44  		      : "rcx", "r11", "memory");
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  45  	return ret;
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  46  }
6b81215d7e8a34 Aruna Ramakrishna 2024-04-25  47  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-05-08 12:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-25 18:05 [PATCH v3 0/4] x86/pkeys: update PKRU to enable pkey 0 before Aruna Ramakrishna
2024-04-25 18:05 ` [PATCH v3 1/4] x86/pkeys: Signal handling function interface changes to accept PKRU as a parameter Aruna Ramakrishna
2024-05-07 12:16   ` Thomas Gleixner
2024-04-25 18:05 ` [PATCH v3 2/4] x86/pkeys: Add helper functions to update PKRU on sigframe Aruna Ramakrishna
2024-05-07 16:16   ` Thomas Gleixner
2024-05-07 17:15     ` Aruna Ramakrishna
2024-04-25 18:05 ` [PATCH v3 3/4] x86/pkeys: Update PKRU to enable all pkeys before XSAVE Aruna Ramakrishna
2024-05-07 16:47   ` Thomas Gleixner
2024-05-07 17:34     ` Aruna Ramakrishna
2024-05-08 12:52       ` Thomas Gleixner
2024-04-25 18:05 ` [PATCH v3 4/4] selftests/mm: Add new testcases for pkeys Aruna Ramakrishna
2024-05-07 12:05   ` Thomas Gleixner
2024-05-07 16:56     ` Thomas Gleixner
2024-05-07 18:04       ` Aruna Ramakrishna
2024-05-08 12:55         ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2024-04-27  4:07 kernel test robot
2024-05-07  3:17 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.