Merge tag 'powerpc-4.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: - Kconfig: remove BE-only platforms from LE kernel build from Boqun Feng - Refresh ps3_defconfig from Geoff Levand - Emit GNU & SysV hashes for the vdso from Michael Ellerman - Define an enum for the bolted SLB indexes from Anshuman Khandual - Use a local to avoid multiple calls to get_slb_shadow() from Michael Ellerman - Add gettimeofday() benchmark from Michael Neuling - Avoid link stack corruption in __get_datapage() from Michael Neuling - Add virt_to_pfn and use this instead of opencoding from Aneesh Kumar K.V - Add ppc64le_defconfig from Michael Ellerman - pseries: extract of_helpers module from Andy Shevchenko - Correct string length in pseries_of_derive_parent() from Nathan Fontenot - Free the MSI bitmap if it was slab allocated from Denis Kirjanov - Shorten irq_chip name for the SIU from Christophe Leroy - Wait 1s for secondaries to enter OPAL during kexec from Samuel Mendoza-Jonas - Fix _ALIGN_* errors due to type difference, from Aneesh Kumar K.V - powerpc/pseries/hvcserver: don't memset pi_buff if it is null from Colin Ian King - Disable hugepd for 64K page size, from Aneesh Kumar K.V - Differentiate between hugetlb and THP during page walk from Aneesh Kumar K.V - Make PCI non-optional for pseries from Michael Ellerman - Individual System V IPC system calls from Sam bobroff - Add selftest of unmuxed IPC calls from Michael Ellerman - discard .exit.data at runtime from Stephen Rothwell - Delete old orphaned PrPMC 280/2800 DTS and boot file, from Paul Gortmaker - Use of_get_next_parent to simplify code from Christophe Jaillet - Paginate some xmon output from Sam bobroff - Add some more elements to the xmon PACA dump from Michael Ellerman - Allow the tm-syscall selftest to build with old headers from Michael Ellerman - Run EBB selftests only on POWER8 from Denis Kirjanov - Drop CONFIG_TUNE_CELL in favour of CONFIG_CELL_CPU from Michael Ellerman - Avoid reference to potentially freed memory in prom.c from Christophe Jaillet - Quieten boot wrapper output with run_cmd from Geoff Levand - EEH fixes and cleanups from Gavin Shan - Fix recursive fenced PHB on Broadcom shiner adapter from Gavin Shan - Use of_get_next_parent() in of_get_ibm_chip_id() from Michael Ellerman - Fix section mismatch warning in msi_bitmap_alloc() from Denis Kirjanov - Fix ps3-lpm white space from Rudhresh Kumar J - Fix ps3-vuart null dereference from Colin King - nvram: Add missing kfree in error path from Christophe Jaillet - nvram: Fix function name in some errors messages, from Christophe Jaillet - drivers/macintosh: adb: fix misleading Kconfig help text from Aaro Koskinen - agp/uninorth: fix a memleak in create_gatt_table from Denis Kirjanov - cxl: Free virtual PHB when removing from Andrew Donnellan - scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target from Michael Ellerman - scripts/kconfig/Makefile: Fix KBUILD_DEFCONFIG check when building with O= from Michael Ellerman - Freescale updates from Scott: Highlights include 64-bit book3e kexec/kdump support, a rework of the qoriq clock driver, device tree changes including qoriq fman nodes, support for a new 85xx board, and some fixes. - MPC5xxx updates from Anatolij: Highlights include a driver for MPC512x LocalPlus Bus FIFO with its device tree binding documentation, mpc512x device tree updates and some minor fixes. * tag 'powerpc-4.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (106 commits) powerpc/msi: Fix section mismatch warning in msi_bitmap_alloc() powerpc/prom: Use of_get_next_parent() in of_get_ibm_chip_id() powerpc/pseries: Correct string length in pseries_of_derive_parent() powerpc/e6500: hw tablewalk: make sure we invalidate and write to the same tlb entry powerpc/mpc85xx: Add FSL QorIQ DPAA FMan support to the SoC device tree(s) powerpc/mpc85xx: Create dts components for the FSL QorIQ DPAA FMan powerpc/fsl: Add #clock-cells and clockgen label to clockgen nodes powerpc: handle error case in cpm_muram_alloc() powerpc: mpic: use IRQCHIP_SKIP_SET_WAKE instead of redundant mpic_irq_set_wake powerpc/book3e-64: Enable kexec powerpc/book3e-64/kexec: Set "r4 = 0" when entering spinloop powerpc/booke: Only use VIRT_PHYS_OFFSET on booke32 powerpc/book3e-64/kexec: Enable SMP release powerpc/book3e-64/kexec: create an identity TLB mapping powerpc/book3e-64: Don't limit paca to 256 MiB powerpc/book3e/kdump: Enable crash_kexec_wait_realmode powerpc/book3e: support CONFIG_RELOCATABLE powerpc/booke64: Fix args to copy_and_flush powerpc/book3e-64: rename interrupt_end_book3e with __end_interrupts powerpc/e6500: kexec: Handle hardware threads ...
This commit is contained in:
@@ -12,7 +12,17 @@ CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CUR
|
||||
|
||||
export CFLAGS
|
||||
|
||||
SUB_DIRS = pmu copyloops mm tm primitives stringloops vphn switch_endian dscr
|
||||
SUB_DIRS = benchmarks \
|
||||
copyloops \
|
||||
dscr \
|
||||
mm \
|
||||
pmu \
|
||||
primitives \
|
||||
stringloops \
|
||||
switch_endian \
|
||||
syscalls \
|
||||
tm \
|
||||
vphn
|
||||
|
||||
endif
|
||||
|
||||
|
||||
1
tools/testing/selftests/powerpc/benchmarks/.gitignore
vendored
Normal file
1
tools/testing/selftests/powerpc/benchmarks/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
gettimeofday
|
||||
12
tools/testing/selftests/powerpc/benchmarks/Makefile
Normal file
12
tools/testing/selftests/powerpc/benchmarks/Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
TEST_PROGS := gettimeofday
|
||||
|
||||
CFLAGS += -O2
|
||||
|
||||
all: $(TEST_PROGS)
|
||||
|
||||
$(TEST_PROGS): ../harness.c
|
||||
|
||||
include ../../lib.mk
|
||||
|
||||
clean:
|
||||
rm -f $(TEST_PROGS) *.o
|
||||
31
tools/testing/selftests/powerpc/benchmarks/gettimeofday.c
Normal file
31
tools/testing/selftests/powerpc/benchmarks/gettimeofday.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2015, Anton Blanchard, IBM Corp.
|
||||
* Licensed under GPLv2.
|
||||
*/
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
static int test_gettimeofday(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
struct timeval tv_start, tv_end;
|
||||
|
||||
gettimeofday(&tv_start, NULL);
|
||||
|
||||
for(i = 0; i < 100000000; i++) {
|
||||
gettimeofday(&tv_end, NULL);
|
||||
}
|
||||
|
||||
printf("time = %.6f\n", tv_end.tv_sec - tv_start.tv_sec + (tv_end.tv_usec - tv_start.tv_usec) * 1e-6);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return test_harness(test_gettimeofday, "gettimeofday");
|
||||
}
|
||||
@@ -63,6 +63,8 @@ int back_to_back_ebbs(void)
|
||||
{
|
||||
struct event event;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ int close_clears_pmcc(void)
|
||||
{
|
||||
struct event event;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ int cpu_event_pinned_vs_ebb(void)
|
||||
int cpu, rc;
|
||||
pid_t pid;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
cpu = pick_online_cpu();
|
||||
FAIL_IF(cpu < 0);
|
||||
FAIL_IF(bind_to_cpu(cpu));
|
||||
|
||||
@@ -41,6 +41,8 @@ int cpu_event_vs_ebb(void)
|
||||
int cpu, rc;
|
||||
pid_t pid;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
cpu = pick_online_cpu();
|
||||
FAIL_IF(cpu < 0);
|
||||
FAIL_IF(bind_to_cpu(cpu));
|
||||
|
||||
@@ -16,6 +16,8 @@ int cycles(void)
|
||||
{
|
||||
struct event event;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@ int cycles_with_freeze(void)
|
||||
uint64_t val;
|
||||
bool fc_cleared;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ int cycles_with_mmcr2(void)
|
||||
int i;
|
||||
bool bad_mmcr2;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/auxvec.h>
|
||||
|
||||
#include "trace.h"
|
||||
#include "reg.h"
|
||||
@@ -319,6 +320,16 @@ void ebb_global_disable(void)
|
||||
mb();
|
||||
}
|
||||
|
||||
bool ebb_is_supported(void)
|
||||
{
|
||||
#ifdef PPC_FEATURE2_EBB
|
||||
/* EBB requires at least POWER8 */
|
||||
return ((long)get_auxv_entry(AT_HWCAP2) & PPC_FEATURE2_EBB);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void event_ebb_init(struct event *e)
|
||||
{
|
||||
e->attr.config |= (1ull << 63);
|
||||
|
||||
@@ -52,6 +52,7 @@ void standard_ebb_callee(void);
|
||||
int ebb_event_enable(struct event *e);
|
||||
void ebb_global_enable(void);
|
||||
void ebb_global_disable(void);
|
||||
bool ebb_is_supported(void);
|
||||
void ebb_freeze_pmcs(void);
|
||||
void ebb_unfreeze_pmcs(void);
|
||||
void event_ebb_init(struct event *e);
|
||||
|
||||
@@ -47,6 +47,8 @@ int ebb_on_child(void)
|
||||
struct event event;
|
||||
pid_t pid;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
FAIL_IF(pipe(read_pipe.fds) == -1);
|
||||
FAIL_IF(pipe(write_pipe.fds) == -1);
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ int ebb_on_willing_child(void)
|
||||
struct event event;
|
||||
pid_t pid;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
FAIL_IF(pipe(read_pipe.fds) == -1);
|
||||
FAIL_IF(pipe(write_pipe.fds) == -1);
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ int ebb_vs_cpu_event(void)
|
||||
int cpu, rc;
|
||||
pid_t pid;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
cpu = pick_online_cpu();
|
||||
FAIL_IF(cpu < 0);
|
||||
FAIL_IF(bind_to_cpu(cpu));
|
||||
|
||||
@@ -16,6 +16,8 @@ int event_attributes(void)
|
||||
{
|
||||
struct event event, leader;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init(&event, 0x1001e);
|
||||
event_leader_ebb_init(&event);
|
||||
/* Expected to succeed */
|
||||
|
||||
@@ -44,6 +44,8 @@ int fork_cleanup(void)
|
||||
{
|
||||
pid_t pid;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -111,6 +111,8 @@ int instruction_count(void)
|
||||
struct event event;
|
||||
uint64_t overhead;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x400FA, "PM_RUN_INST_CMPL");
|
||||
event_leader_ebb_init(&event);
|
||||
event.attr.exclude_kernel = 1;
|
||||
|
||||
@@ -23,6 +23,8 @@ static int test_body(void)
|
||||
int i, orig_period, max_period;
|
||||
struct event event;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
/* We use PMC4 to make sure the kernel switches all counters correctly */
|
||||
event_init_named(&event, 0x40002, "instructions");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
@@ -18,6 +18,8 @@ int multi_counter(void)
|
||||
struct event events[6];
|
||||
int i, group_fd;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&events[0], 0x1001C, "PM_CMPLU_STALL_THRD");
|
||||
event_init_named(&events[1], 0x2D016, "PM_CMPLU_STALL_FXU");
|
||||
event_init_named(&events[2], 0x30006, "PM_CMPLU_STALL_OTHER_CMPL");
|
||||
|
||||
@@ -79,6 +79,8 @@ int multi_ebb_procs(void)
|
||||
pid_t pids[NR_CHILDREN];
|
||||
int cpu, rc, i;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
cpu = pick_online_cpu();
|
||||
FAIL_IF(cpu < 0);
|
||||
FAIL_IF(bind_to_cpu(cpu));
|
||||
|
||||
@@ -19,6 +19,8 @@ static int no_handler_test(void)
|
||||
u64 val;
|
||||
int i;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ static int test_body(void)
|
||||
{
|
||||
struct event event;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
event_init_named(&event, 0x1001e, "cycles");
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ int pmc56_overflow(void)
|
||||
{
|
||||
struct event event;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
/* Use PMC2 so we set PMCjCE, which enables PMC5/6 */
|
||||
event_init(&event, 0x2001e);
|
||||
event_leader_ebb_init(&event);
|
||||
|
||||
@@ -18,6 +18,8 @@ int reg_access(void)
|
||||
{
|
||||
uint64_t val, expected;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
expected = 0x8000000100000000ull;
|
||||
mtspr(SPRN_BESCR, expected);
|
||||
val = mfspr(SPRN_BESCR);
|
||||
|
||||
@@ -42,6 +42,8 @@ int task_event_pinned_vs_ebb(void)
|
||||
pid_t pid;
|
||||
int rc;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
FAIL_IF(pipe(read_pipe.fds) == -1);
|
||||
FAIL_IF(pipe(write_pipe.fds) == -1);
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ int task_event_vs_ebb(void)
|
||||
pid_t pid;
|
||||
int rc;
|
||||
|
||||
SKIP_IF(!ebb_is_supported());
|
||||
|
||||
FAIL_IF(pipe(read_pipe.fds) == -1);
|
||||
FAIL_IF(pipe(write_pipe.fds) == -1);
|
||||
|
||||
|
||||
1
tools/testing/selftests/powerpc/syscalls/.gitignore
vendored
Normal file
1
tools/testing/selftests/powerpc/syscalls/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
ipc_unmuxed
|
||||
12
tools/testing/selftests/powerpc/syscalls/Makefile
Normal file
12
tools/testing/selftests/powerpc/syscalls/Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
TEST_PROGS := ipc_unmuxed
|
||||
|
||||
CFLAGS += -I../../../../../usr/include
|
||||
|
||||
all: $(TEST_PROGS)
|
||||
|
||||
$(TEST_PROGS): ../harness.c
|
||||
|
||||
include ../../lib.mk
|
||||
|
||||
clean:
|
||||
rm -f $(TEST_PROGS) *.o
|
||||
47
tools/testing/selftests/powerpc/syscalls/ipc.h
Normal file
47
tools/testing/selftests/powerpc/syscalls/ipc.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifdef __NR_semop
|
||||
DO_TEST(semop, __NR_semop)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_semget
|
||||
DO_TEST(semget, __NR_semget)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_semctl
|
||||
DO_TEST(semctl, __NR_semctl)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_semtimedop
|
||||
DO_TEST(semtimedop, __NR_semtimedop)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_msgsnd
|
||||
DO_TEST(msgsnd, __NR_msgsnd)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_msgrcv
|
||||
DO_TEST(msgrcv, __NR_msgrcv)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_msgget
|
||||
DO_TEST(msgget, __NR_msgget)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_msgctl
|
||||
DO_TEST(msgctl, __NR_msgctl)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_shmat
|
||||
DO_TEST(shmat, __NR_shmat)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_shmdt
|
||||
DO_TEST(shmdt, __NR_shmdt)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_shmget
|
||||
DO_TEST(shmget, __NR_shmget)
|
||||
#endif
|
||||
|
||||
#ifdef __NR_shmctl
|
||||
DO_TEST(shmctl, __NR_shmctl)
|
||||
#endif
|
||||
61
tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
Normal file
61
tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright 2015, Michael Ellerman, IBM Corp.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This test simply tests that certain syscalls are implemented. It doesn't
|
||||
* actually exercise their logic in any way.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
#define DO_TEST(_name, _num) \
|
||||
static int test_##_name(void) \
|
||||
{ \
|
||||
int rc; \
|
||||
printf("Testing " #_name); \
|
||||
errno = 0; \
|
||||
rc = syscall(_num, -1, 0, 0, 0, 0, 0); \
|
||||
printf("\treturned %d, errno %d\n", rc, errno); \
|
||||
return errno == ENOSYS; \
|
||||
}
|
||||
|
||||
#include "ipc.h"
|
||||
#undef DO_TEST
|
||||
|
||||
static int ipc_unmuxed(void)
|
||||
{
|
||||
int tests_done = 0;
|
||||
|
||||
#define DO_TEST(_name, _num) \
|
||||
FAIL_IF(test_##_name()); \
|
||||
tests_done++;
|
||||
|
||||
#include "ipc.h"
|
||||
#undef DO_TEST
|
||||
|
||||
/*
|
||||
* If we ran no tests then it means none of the syscall numbers were
|
||||
* defined, possibly because we were built against old headers. But it
|
||||
* means we didn't really test anything, so instead of passing mark it
|
||||
* as a skip to give the user a clue.
|
||||
*/
|
||||
SKIP_IF(tests_done == 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return test_harness(ipc_unmuxed, "ipc_unmuxed");
|
||||
}
|
||||
@@ -77,13 +77,23 @@ pid_t getppid_tm(bool suspend)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
static inline bool have_htm_nosc(void)
|
||||
{
|
||||
#ifdef PPC_FEATURE2_HTM_NOSC
|
||||
return ((long)get_auxv_entry(AT_HWCAP2) & PPC_FEATURE2_HTM_NOSC);
|
||||
#else
|
||||
printf("PPC_FEATURE2_HTM_NOSC not defined, can't check AT_HWCAP2\n");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
int tm_syscall(void)
|
||||
{
|
||||
unsigned count = 0;
|
||||
struct timeval end, now;
|
||||
|
||||
SKIP_IF(!((long)get_auxv_entry(AT_HWCAP2)
|
||||
& PPC_FEATURE2_HTM_NOSC));
|
||||
SKIP_IF(!have_htm_nosc());
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
printf("Testing transactional syscalls for %d seconds...\n", TEST_DURATION);
|
||||
|
||||
Reference in New Issue
Block a user