Merge tag 'linux-kselftest-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull Kselftest update from Shuah Khan: "This update consists of: - fixes to several existing tests from Stafford Horne - cpufreq tests from Viresh Kumar - Selftest build and install fixes from Bamvor Jian Zhang and Michael Ellerman - Fixes to protection-keys tests from Dave Hansen - Warning fixes from Shuah Khan" * tag 'linux-kselftest-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (28 commits) selftests/powerpc: Fix remaining fallout from recent changes selftests/powerpc: Fix the clean rule since recent changes selftests: Fix the .S and .S -> .o rules selftests: Fix the .c linking rule selftests: Fix selftests build to just build, not run tests selftests, x86, protection_keys: fix wrong offset in siginfo selftests, x86, protection_keys: fix uninitialized variable warning selftest: cpufreq: Update MAINTAINERS file selftest: cpufreq: Add special tests selftest: cpufreq: Add support to test cpufreq modules selftest: cpufreq: Add suspend/resume/hibernate support selftest: cpufreq: Add support for cpufreq tests selftests: Add intel_pstate to TARGETS selftests/intel_pstate: Update makefile to match new style selftests/intel_pstate: Fix warning on loop index overflow cpupower: Restore format of frequency-info limit selftests/futex: Add headers to makefile dependencies selftests/futex: Add stdio used for logging selftests: x86 protection_keys remove dead code selftests: x86 protection_keys fix unused variable compile warnings ...
This commit is contained in:
@@ -17,6 +17,9 @@ TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY)
|
||||
BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32)
|
||||
BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64)
|
||||
|
||||
BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
|
||||
BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64))
|
||||
|
||||
CFLAGS := -O2 -g -std=gnu99 -pthread -Wall
|
||||
|
||||
UNAME_M := $(shell uname -m)
|
||||
@@ -40,10 +43,10 @@ all_64: $(BINARIES_64)
|
||||
clean:
|
||||
$(RM) $(BINARIES_32) $(BINARIES_64)
|
||||
|
||||
$(TARGETS_C_32BIT_ALL:%=%_32): %_32: %.c
|
||||
$(BINARIES_32): $(OUTPUT)/%_32: %.c
|
||||
$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm
|
||||
|
||||
$(TARGETS_C_64BIT_ALL:%=%_64): %_64: %.c
|
||||
$(BINARIES_64): $(OUTPUT)/%_64: %.c
|
||||
$(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
|
||||
|
||||
# x86_64 users should be encouraged to install 32-bit libraries
|
||||
@@ -65,12 +68,12 @@ warn_32bit_failure:
|
||||
endif
|
||||
|
||||
# Some tests have additional dependencies.
|
||||
sysret_ss_attrs_64: thunks.S
|
||||
ptrace_syscall_32: raw_syscall_helper_32.S
|
||||
test_syscall_vdso_32: thunks_32.S
|
||||
$(OUTPUT)/sysret_ss_attrs_64: thunks.S
|
||||
$(OUTPUT)/ptrace_syscall_32: raw_syscall_helper_32.S
|
||||
$(OUTPUT)/test_syscall_vdso_32: thunks_32.S
|
||||
|
||||
# check_initial_reg_state is special: it needs a custom entry, and it
|
||||
# needs to be static so that its interpreter doesn't destroy its initial
|
||||
# state.
|
||||
check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static
|
||||
check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static
|
||||
$(OUTPUT)/check_initial_reg_state_32: CFLAGS += -Wl,-ereal_start -static
|
||||
$(OUTPUT)/check_initial_reg_state_64: CFLAGS += -Wl,-ereal_start -static
|
||||
|
@@ -192,7 +192,7 @@ void lots_o_noops_around_write(int *write_to_me)
|
||||
#define SYS_pkey_alloc 381
|
||||
#define SYS_pkey_free 382
|
||||
#define REG_IP_IDX REG_EIP
|
||||
#define si_pkey_offset 0x18
|
||||
#define si_pkey_offset 0x14
|
||||
#else
|
||||
#define SYS_mprotect_key 329
|
||||
#define SYS_pkey_alloc 330
|
||||
@@ -462,7 +462,7 @@ void pkey_disable_set(int pkey, int flags)
|
||||
unsigned long syscall_flags = 0;
|
||||
int ret;
|
||||
int pkey_rights;
|
||||
u32 orig_pkru;
|
||||
u32 orig_pkru = rdpkru();
|
||||
|
||||
dprintf1("START->%s(%d, 0x%x)\n", __func__,
|
||||
pkey, flags);
|
||||
@@ -812,8 +812,6 @@ void setup_hugetlbfs(void)
|
||||
{
|
||||
int err;
|
||||
int fd;
|
||||
int validated_nr_pages;
|
||||
int i;
|
||||
char buf[] = "123";
|
||||
|
||||
if (geteuid() != 0) {
|
||||
@@ -1116,11 +1114,6 @@ void test_pkey_syscalls_on_non_allocated_pkey(int *ptr, u16 pkey)
|
||||
err = sys_pkey_free(i);
|
||||
pkey_assert(err);
|
||||
|
||||
/* not enforced when pkey_get() is not a syscall
|
||||
err = pkey_get(i, 0);
|
||||
pkey_assert(err < 0);
|
||||
*/
|
||||
|
||||
err = sys_pkey_free(i);
|
||||
pkey_assert(err);
|
||||
|
||||
@@ -1133,14 +1126,8 @@ void test_pkey_syscalls_on_non_allocated_pkey(int *ptr, u16 pkey)
|
||||
void test_pkey_syscalls_bad_args(int *ptr, u16 pkey)
|
||||
{
|
||||
int err;
|
||||
int bad_flag = (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE) + 1;
|
||||
int bad_pkey = NR_PKEYS+99;
|
||||
|
||||
/* not enforced when pkey_get() is not a syscall
|
||||
err = pkey_get(bad_pkey, bad_flag);
|
||||
pkey_assert(err < 0);
|
||||
*/
|
||||
|
||||
/* pass a known-invalid pkey in: */
|
||||
err = sys_mprotect_pkey(ptr, PAGE_SIZE, PROT_READ, bad_pkey);
|
||||
pkey_assert(err);
|
||||
@@ -1149,8 +1136,6 @@ void test_pkey_syscalls_bad_args(int *ptr, u16 pkey)
|
||||
/* Assumes that all pkeys other than 'pkey' are unallocated */
|
||||
void test_pkey_alloc_exhaust(int *ptr, u16 pkey)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long init_val;
|
||||
int err;
|
||||
int allocated_pkeys[NR_PKEYS] = {0};
|
||||
int nr_allocated_pkeys = 0;
|
||||
|
Reference in New Issue
Block a user