instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inde 'tools/testing/selftests/powerpc/lib/reg' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * test helper assembly functions * * Copyright (C) 2016 Simon Guo, IBM Corporation. */ #include <ppc-asm.h> #include "reg.h" /* Non volatile GPR - unsigned long buf[18] */ FUNC_START(load_gpr) ld 14, 0*8(3) ld 15, 1*8(3) ld 16, 2*8(3) ld 17, 3*8(3...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/count_instructions' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2013, Michael Ellerman, IBM Corp. */ #define _GNU_SOURCE #include <stdio.h> #include <stdbool.h> #include <string.h> #include <sys/prctl.h> #include "event.h" #include "utils.h" #include "lib.h" extern void thirty_two_instruction_loop(u64 loops); stati...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/powerpc/pmu/event' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2013, Michael Ellerman, IBM Corp. */ #ifndef _SELFTESTS_POWERPC_PMU_EVENT_H #define _SELFTESTS_POWERPC_PMU_EVENT_H #include <unistd.h> #include <linux/perf_event.h> #include "utils.h" struct event { struct perf_event_attr attr; char *name; int fd...
Linux kernel'inde 'tools/testing/selftests/powerpc/pmu/loop' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2013, Michael Ellerman, IBM Corp. */ #include <ppc-asm.h> .text FUNC_START(thirty_two_instruction_loop) cmpdi r3,0 beqlr addi r4,r3,1 addi r4,r4,1 addi r4,r4,1 addi r4,r4,1 addi r4,r4,1 addi r4,r4,1 addi r4,r4,1 addi r4,r4,1 addi r4...
Linux kernel'inde 'tools/testing/selftests/powerpc/pmu/branch_loops' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <ppc-asm.h> .text #define ITER_SHIFT 31 FUNC_START(indirect_branch_loop) li r3, 1 sldi r3, r3, ITER_SHIFT 1: cmpdi r3, 0 beqlr addi r3, r3, -1 ld r4, 2f@got(%r2) mtctr r4 bctr .balign 32 2: ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/l3_bank_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "event.h" #include "utils.h" #define MALLOC_SIZE (0x10000 * 10) /* Ought to be enough .. */ /* * Tests that the L3 bank handling is correct. We fixed it in commit...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2013, Michael Ellerman, IBM Corp. */ #define _GNU_SOURCE #include <unistd.h> #include <sys/syscall.h> #include <string.h> #include <stdio.h> #include <stdbool.h> #include <sys/ioctl.h> #include "event.h" int perf_event_open(struct perf_event_attr *attr,...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/per_event_excludes' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #define _GNU_SOURCE #include <elf.h> #include <limits.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <sys/prctl.h> #include "event.h" #include "lib.h" #include "utils.h" /* * Test that per-e...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/powerpc/pmu/lib' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #ifndef __SELFTESTS_POWERPC_PMU_LIB_H #define __SELFTESTS_POWERPC_PMU_LIB_H #include <stdbool.h> #include <stdio.h> #include <stdint.h> #include <string.h> #include <unistd.h> union pipe { struct { int read_fd; ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/lib' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #define _GNU_SOURCE /* For CPU_ZERO etc. */ #include <errno.h> #include <sched.h> #include <setjmp.h> #include <stdlib.h> #include <sys/wait.h> #include "utils.h" #include "lib.h" #define PARENT_TOKEN 0xAA #define CH...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/count_stcx_fail' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright 2013, Michael Ellerman, IBM Corp. * Licensed under GPLv2. */ #define _GNU_SOURCE #include <stdio.h> #include <stdbool.h> #include <string.h> #include <sys/prctl.h> #include "event.h" #include "utils.h" #include "lib.h" extern void thirty_two_instruction_loop_with_ll_sc(u64 loops, u64 *ll_sc_t...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_pmc56_exclude_constraints_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include <sys/prctl.h> #include <limits.h> #include "../sampling_tests/misc.h" /* * Testcase for group constraint check for * Performance Monitor Counter 5 (PMC5) and also * Per...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_pmc_count_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" /* * Testcase for number of counters in use. * The number of programmable counters is from * performance monitor counter 1 to performance * ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/event_alternatives_tests_p9' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" #define PM_RUN_CYC_ALT 0x200f4 #define PM_INST_DISP 0x200f2 #define PM_BR_2PATH 0x20036 #define PM_LD_MISS_L1 0x3e054 #define PM_RUN_INST_CMPL_A...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/invalid_event_code_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <sys/prctl.h> #include <limits.h> #include "../event.h" #include "../sampling_tests/misc.h" /* The data cache was reloaded from local core's L3 due to a demand load */ #define EventCode_1 0x134...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/event_alternatives_tests_p10' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" #define PM_RUN_CYC_ALT 0x200f4 #define PM_INST_DISP 0x200f2 #define PM_BR_2PATH 0x20036 #define PM_LD_MISS_L1 0x3e054 #define PM_RUN_INST_CMPL_A...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/reserved_bits_mmcra_sample_elig_mode_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" /* * Testcase for reserved bits in Monitor Mode Control * Register A (MMCRA) Random Sampling Mode (SM) value. * As per Instruction Set Archit...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_unit_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "utils.h" #include "../sampling_tests/misc.h" /* All successful D-side store dispatches for this thread with PMC 2 */ #define EventCode_1 0x26080 /* All ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/hw_cache_event_type_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "utils.h" #include "../sampling_tests/misc.h" /* * Load Missed L1, for power9 its pointing to PM_LD_MISS_L1_FIN (0x2c04e) and * for power10 its pointin...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_thresh_cmp_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "utils.h" #include "../sampling_tests/misc.h" /* * Primary PMU events used here is PM_MRK_INST_CMPL (0x401e0) and * PM_THRESH_MET (0x101ec) * Threshol...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_radix_scope_qual_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" /* PM_DATA_RADIX_PROCESS_L2_PTE_FROM_L2 */ #define EventCode_1 0x14242 /* PM_DATA_RADIX_PROCESS_L2_PTE_FROM_L3 */ #define EventCode_2 0x24242 /...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_mmcra_sample_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" #define EventCode_1 0x35340401e0 #define EventCode_2 0x353c0101ec #define EventCode_3 0x35340101ec /* * Test that using different sample bits i...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_l2l3_sel_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "utils.h" #include "../sampling_tests/misc.h" /* All successful D-side store dispatches for this thread */ #define EventCode_1 0x010000046080 /* All succ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/reserved_bits_mmcra_thresh_ctl_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" /* * Testcase for reserved bits in Monitor Mode * Control Register A (MMCRA) thresh_ctl bits. * For MMCRA[48:51]/[52:55]) Threshold Start/Sto...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_thresh_ctl_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "utils.h" #include "../sampling_tests/misc.h" /* * Primary PMU events used here are PM_MRK_INST_CMPL (0x401e0) and * PM_THRESH_MET (0x101ec). * Thresh...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/generic_events_valid_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <sys/prctl.h> #include <limits.h> #include "../event.h" #include "../sampling_tests/misc.h" /* * Testcase to ensure that using invalid event in generic * event for PERF_TYPE_HARDWARE should f...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_cache_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "utils.h" #include "../sampling_tests/misc.h" /* All L1 D cache load references counted at finish, gated by reject */ #define EventCode_1 0x1100fc /* Loa...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/blacklisted_events_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <sys/prctl.h> #include <limits.h> #include "../event.h" #include "../sampling_tests/misc.h" #define PM_DTLB_MISS_16G 0x1c058 #define PM_DERAT_MISS_2M 0x1c05a #define PM_DTLB_MISS_2M 0x1c05c #de...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_pmc56_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" /* * Testcase for checking constraint checks for * Performance Monitor Counter 5 (PMC5) and also * Performance Monitor Counter 6 (PMC6). Even...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_thresh_sel_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "utils.h" #include "../sampling_tests/misc.h" /* * Primary PMU events used here are PM_MRK_INST_CMPL (0x401e0) and * PM_THRESH_MET (0x101ec). * Thresh...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/event_code_tests/group_constraint_repeat_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include "../event.h" #include "../sampling_tests/misc.h" /* The processor's L1 data cache was reloaded */ #define EventCode1 0x21C040 #define EventCode2 0x22C040 /* * Testcase for group constraint ch...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/reg_access_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test basic access to the EBB regs, they should be user accessible with no * kernel interaction required. */ int reg_access(void) { uint64_t val, expect...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test that PMC5 & 6 are frozen (ie. don't overflow) when they are not being * used. Tests the MMCR0_FC56 logic in the kernel. */ static int pmc56_overfl...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/trace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include "trace.h" struct trace_buffer *trace_buffer_allocate(u64 size) { struct trace_buffer *tb; if (size < siz...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/ebb' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #define _GNU_SOURCE /* For CPU_ZERO etc. */ #include <sched.h> #include <sys/wait.h> #include <setjmp.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include "...
Linux kernel'inde 'tools/testing/selftests/powerpc/pmu/ebb/ebb_handler' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <ppc-asm.h> #include "reg.h" /* ppc-asm.h defines most of the reg aliases, but not r1/r2. */ #define r1 1 #define r2 2 #define RFEBB .long 0x4c000924 /* Stack layout: * * ^ ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #define _GNU_SOURCE #include <stdio.h> #include <stdbool.h> #include <string.h> #include <sys/prctl.h> #include "ebb.h" /* * Run a calibrated instruction loop and count instructions executed using * EBBs. Make sur...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/close_clears_pmcc_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #include <signal.h> #include "ebb.h" /* * Test that closing the EBB event clears MMCR0_PMCC, preventing further access * by userspace to the PMU hardware. ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/task_event_pinned_vs_ebb_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a pinned per-task event vs an EBB - in tha...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/multi_counter_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include "ebb.h" /* * Test counting multiple events using EBBs. */ int multi_counter(void) { struct event events[6]; int i, group_fd; SKIP_IF(!ebb_i...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/back_to_back_ebbs_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "ebb.h" #define NUMBER_OF_EBBS 50 /* * Test that if we overflow the counter while in the EBB handler, we take * another EBB on exiting from the ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/event_attributes_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test various attributes of the EBB event are enforced. */ int event_attributes(void) { struct event event, leader; SKIP_IF(!ebb_is_supported()); eve...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/ebb_on_child_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests we can setup an EBB on our child. Nothing ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/cpu_event_pinned_vs_ebb_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a pinned cpu event vs an EBB - in that ord...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/powerpc/pmu/ebb/trace' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #ifndef _SELFTESTS_POWERPC_PMU_EBB_TRACE_H #define _SELFTESTS_POWERPC_PMU_EBB_TRACE_H #include "utils.h" #define TRACE_TYPE_REG 1 #define TRACE_TYPE_COUNTER 2 #define TRACE_TYPE_STRING 3 #define TRACE_TYPE_INDENT ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/multi_ebb_procs_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <signal.h> #include "ebb.h" /* * Test running multiple EBB using processes at once on a single CPU. They * should all run happily without interfe...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/cpu_event_vs_ebb_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a cpu event vs an EBB - in that order. The...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/fork_cleanup_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <setjmp.h> #include "ebb.h" /* * Test that a fork clears the ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/ebb_vs_cpu_event_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests an EBB vs a cpu event - in that order. The...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/cycles_with_freeze_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "ebb.h" /* * Test of counting cycles while using MMCR0_FC (freeze counters) to only count * parts of the code. This is complicated by the fact th...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/regs_access_pmccext_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2021, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #include <signal.h> #include "ebb.h" /* * Test that closing the EBB event clears MMCR0_PMCC and * sets MMCR0_PMCCEXT preventing further read access to the * ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/task_event_vs_ebb_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests a per-task event vs an EBB - in that order...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/no_handler_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #include <signal.h> #include "ebb.h" /* Test that things work sanely if we have no handler */ static int no_handler_test(void) { struct event event; u64 v...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/cycles_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Basic test that counts user cycles and takes EBBs. */ int cycles(void) { struct event event; SKIP_IF(!ebb_is_supported()); event_init_named(&event, ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/powerpc/pmu/ebb/ebb' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #ifndef _SELFTESTS_POWERPC_PMU_EBB_EBB_H #define _SELFTESTS_POWERPC_PMU_EBB_EBB_H #include "../event.h" #include "../lib.h" #include "trace.h" #include "reg.h" #define PMC_INDEX(pmc) ((pmc)-1) #define NUM_PMC_VALU...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/cycles_with_mmcr2_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "ebb.h" /* * Test of counting cycles while manipulating the user accessible bits in MMCR2. */ /* We use two values because the first freezes PMC...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/lost_exception_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> #include "ebb.h" /* * Test that tries to trigger CPU_FTR_PMAO_BUG. Which is a hardware defect * where an exception...
Linux kernel'inde 'tools/testing/selftests/powerpc/pmu/ebb/busy_loop' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <ppc-asm.h> .text FUNC_START(core_busy_loop) stdu %r1, -168(%r1) std r14, 160(%r1) std r15, 152(%r1) std r16, 144(%r1) std r17, 136(%r1) std r18, 128(%r1) std r19, 120(%r1) std r20, 112(%r1...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/ebb_on_willing_child_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "ebb.h" /* * Tests we can setup an EBB on our child. The chil...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/ebb/pmae_handling_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014, Michael Ellerman, IBM Corp. */ #include <sched.h> #include <signal.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "ebb.h" /* * Test that the kernel properly handles PMAE across context switches. * * We test this by call...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr3_src_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop_with_ll_sc(u64 loops, u64 *ll_sc_target); /* The data cache was reloaded from local ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/intr_regs_no_crash_wo_pmu_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* * A perf sampling test for making sure * sampling with -intr-regs doesn't crash * in any environment, say: * - Wit...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_fc56_pmc1ce_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* * A perf sampling test for mmcr0 * fields: fc56, pmc1ce. */ sta...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_disable_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* Instructions */ #define EventCode 0x500fa /* * A perf sampling test...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_disable_no_branch_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* Instructions */ #define EventCode 0x500fa /* * A perf sampling test...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_cc56run_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* * A perf sampling test for mmcr0 * field: cc56run. */ static in...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/check_extended_reg_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2024, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* * A perf sampling test to check extended * reg support. */ static int check_extended_reg_test(void) { /* Check for pla...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_pmccext_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* * A perf sampling test for mmcr0 * field: pmccext */ static int...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_pmcjce_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* * A perf sampling test for mmcr0 * field: pmcjce */ static int ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr2_fcs_fch_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Madhavan Srinivasan, IBM Corp. */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); static bool is_hv; ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_fc56_pmc56_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* * A perf sampling test for mmcr0 * fields: fc56_pmc56 */ static...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr2_l2l3_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Madhavan Srinivasan, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* All successful D-side store dispatches for this thread */ #define EventCode 0x010000046080 #define MALLOC_SIZE ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/powerpc/pmu/sampling_tests/misc' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2022, Athira Rajeev, IBM Corp. * Copyright 2022, Madhavan Srinivasan, IBM Corp. * Copyright 2022, Kajol Jain, IBM Corp. */ #include <sys/stat.h> #include "../event.h" #define POWER11 0x82 #define POWER10 0x80 #define POWER9 0x4e #define PERF_POWER9_...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/misc' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. * Copyright 2022, Madhavan Srinivasan, IBM Corp. * Copyright 2022, Kajol Jain, IBM Corp. */ #include <unistd.h> #include <sys/syscall.h> #include <string.h> #include <stdio.h> #include <sys/ioctl.h> #include <sys/mman.h> #i...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr1_comb_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* All successful D-side store dispatches for this thread that were L2 Miss */ #define EventCode 0x46880 extern void thir...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_ind_call_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void indirect_branch_loop(void); /* Instructions */ #define EventCode 0x500fa /* ifm field for indirect branch mode ...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_cond_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* Instructions */ #define EventCode 0x500fa /* ifm field for condition...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_thresh_cmp_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* * Primary PMU event used here is PM_MRK_INST_CMPL (0x401e0) * Threshold event selection used is issue to complete for cy...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_bhrb_any_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* Instructions */ #define EventCode 0x500fa /* ifm field for any branc...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_thresh_marked_sample_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Kajol Jain, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* * Primary PMU event used here is PM_MRK_INST_CMPL (0x401e0) * Threshold event selection used is issue to complete for cy...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/bhrb_no_crash_wo_pmu_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* * A perf sampling test for making sure * enabling branch stack doesn't crash in any * environment, say: * - With g...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_exceptionbits_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" extern void thirty_two_instruction_loop(int loops); /* * A perf sampling test for mmcr0 * fields : pmae, pmao. */ stat...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr1_sel_unit_cache_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" #define MALLOC_SIZE (0x10000 * 10) /* Ought to be enough .. */ /* The data cache was reloaded from local core's L3 d...
Linux kernel'inin 'tools/testing/selftests/powerpc/pmu/sampling_tests/bhrb_filter_map_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2022, Athira Rajeev, IBM Corp. */ #include <stdio.h> #include <stdlib.h> #include "../event.h" #include "misc.h" #include "utils.h" /* * A perf sampling test to check bhrb filter * map. All the branch filters are not supported * in powerpc. Supported ...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright 2018, Breno Leitao, Gustavo Romero, IBM Corp. * * This test raises a SIGUSR1 signal, and toggle the MSR[TS] * fields at the signal handler. With MSR[TS] being set, the kernel will * force a recheckpoint, which may cause a segfault when returning to * user sp...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-vmxcopy' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2015, Michael Neuling, IBM Corp. * * Original: Michael Neuling 4/12/2013 * Edited: Rashmica Gupta 4/12/2015 * * See if the altivec state is leaked out of an aborted transaction due to * kernel vmx copy loops. * * When the transaction aborts, VSR valu...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-signal-context-chk-gpr' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright 2016, Cyril Bur, IBM Corp. * * Test the kernel's signal frame code. * * The kernel sets up two sets of ucontexts if the signal was to be * delivered while the thread was in a transaction (referred too as * first and second contexts). * Expected be...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-poison' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2019, Gustavo Romero, Michael Neuling, IBM Corp. * * This test will spawn two processes. Both will be attached to the same * CPU (CPU 0). The child will be in a loop writing to FP register f31 and * VMX/VEC/Altivec register vr31 a known value, called poi...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-exec' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright 2016, Cyril Bur, IBM Corp. * * Syscalls can be performed provided the transactions are suspended. * The exec() class of syscall is unique as a new process is loaded. * * It makes little sense for after an exec() call for the previously * suspended ...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-sigreturn' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright 2015, Laurent Dufour, IBM Corp. * * Test the kernel's signal returning code to check reclaim is done if the * sigreturn() is called while in a transaction (suspended since active is * already dropped trough the system call path). * * The kernel must discar...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-trap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2017, Gustavo Romero, IBM Corp. * * Check if thread endianness is flipped inadvertently to BE on trap * caught in TM whilst MSR.FP and MSR.VEC are zero (i.e. just after * load_fp and load_vec overflowed). * * The issue can be checked on LE machines sim...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-signal-stack' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2015, Michael Neuling, IBM Corp. * * Test the kernel's signal delievery code to ensure that we don't * trelaim twice in the kernel signal delivery code. This can happen * if we trigger a signal when in a transaction and the stack pointer * is bogus. *...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-syscall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2015, Sam Bobroff, IBM Corp. * * Test the kernel's system call code to ensure that a system call * made from within an active HTM transaction is aborted with the * correct failure code. * Conversely, ensure that a system call made from within a * suspe...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-unavailable' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2017, Gustavo Romero, Breno Leitao, Cyril Bur, IBM Corp. * * Force FP, VEC and VSX unavailable exception during transaction in all * possible scenarios regarding the MSR.FP and MSR.VEC state, e.g. when FP * is enable and VEC is disable, when FP is disabl...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/powerpc/tm/tm' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2015, Michael Ellerman, IBM Corp. */ #ifndef _SELFTESTS_POWERPC_TM_TM_H #define _SELFTESTS_POWERPC_TM_TM_H #include <stdbool.h> #include <asm/tm.h> #include "utils.h" #include "reg.h" #define TM_RETRIES 100 static inline bool have_htm(void) { #ifdef...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright 2018, Breno Leitao, Gustavo Romero, IBM Corp. * * A test case that creates a signal and starts a suspended transaction * inside the signal handler. * * It returns from the signal handler with the CPU at suspended state, but * without setting usercontext MSR...
Linux kernel'inde 'tools/testing/selftests/powerpc/tm/tm-syscall-asm' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0 */ #include <basic_asm.h> #include <asm/unistd.h> .text FUNC_START(getppid_tm_active) tbegin. beq 1f li r0, __NR_getppid sc tend. blr 1: li r3, -1 blr FUNC_START(getppid_tm_suspended) tbegin. beq 1f li r0, __NR_getppid tsuspend. sc tresume. tend. blr 1:...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-signal-pagefault' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright 2020, Gustavo Luiz Duarte, IBM Corp. * * This test starts a transaction and triggers a signal, forcing a pagefault to * happen when the kernel signal handling code touches the user signal stack. * * In order to avoid pre-faulting the signal stack memory and ...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-signal-context-chk-vsx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright 2016, Cyril Bur, IBM Corp. * * Test the kernel's signal frame code. * * The kernel sets up two sets of ucontexts if the signal was to be * delivered while the thread was in a transaction (referred too as * first and second contexts). * Expected be...
Linux kernel'inin 'tools/testing/selftests/powerpc/tm/tm-signal-context-chk-fpu' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright 2016, Cyril Bur, IBM Corp. * * Test the kernel's signal frame code. * * The kernel sets up two sets of ucontexts if the signal was to be * delivered while the thread was in a transaction (referred too as * first and second contexts). * Expected be...