instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'tools/testing/selftests/kvm/get-reg-list' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Check for KVM_GET_REG_LIST regressions. * * Copyright (C) 2020, Red Hat, Inc. * * When attempting to migrate from a host with an older kernel to a host * with a newer kernel we allow the newer kernel on the destination to * list new registers with get-reg-list. We as...
Linux kernel'inin 'tools/testing/selftests/kvm/kvm_create_max_vcpus' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * kvm_create_max_vcpus * * Copyright (C) 2019, Google LLC. * * Test for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_VCPU_ID. */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "test_util.h" #include "kvm_util.h" #include "asm/kvm.h" #...
Linux kernel'inin 'tools/testing/selftests/kvm/guest_memfd_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright Intel Corporation, 2023 * * Author: Chao Peng <chao.p.peng@linux.intel.com> */ #include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <stdio.h> #include <fcntl.h> #include <linux/bitmap.h> #include <linux/falloc.h> #include <l...
Linux kernel'inin 'tools/testing/selftests/kvm/coalesced_io_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <linux/sizes.h> #include <kvm_util.h> #include <processor.h> #include "ucall_common.h" struct kvm_coalesced_io { struct kvm_coalesced_mmio_ring *ring; u32 ring_si...
Linux kernel'inin 'tools/testing/selftests/kvm/memslot_modification_stress_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * KVM memslot modification stress test * Adapted from demand_paging_test.c * * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2020, Google, Inc. */ #include <stdio.h> #include <stdlib.h> #include <sys/syscall.h> #include <unistd.h> #include <asm/unistd.h> #include <t...
Linux kernel'inin 'tools/testing/selftests/kvm/demand_paging_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * KVM demand paging test * Adapted from dirty_log_test.c * * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019, Google, Inc. */ #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <pthread.h> #include <linux/userfaultfd.h> #inclu...
Linux kernel'inin 'tools/testing/selftests/kvm/system_counter_offset_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2021, Google LLC. * * Tests for adjusting the system counter from userspace */ #include <asm/kvm_para.h> #include <stdint.h> #include <string.h> #include <sys/stat.h> #include <time.h> #include "test_util.h" #include "kvm_util.h" #include "processor....
Linux kernel'inin 'tools/testing/selftests/kvm/steal_time' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * steal/stolen time test * * Copyright (C) 2020, Red Hat, Inc. */ #include <stdio.h> #include <time.h> #include <sched.h> #include <pthread.h> #include <linux/kernel.h> #include <asm/kvm.h> #ifdef __riscv #include "sbi.h" #else #include <asm/kvm_para.h> #endif #include "...
Linux kernel'inin 'tools/testing/selftests/kvm/arch_timer' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * arch_timer.c - Tests the arch timer IRQ functionality * * The guest's main thread configures the timer interrupt and waits * for it to fire, with a timeout equal to the timer period. * It asserts that the timeout doesn't exceed the timer period plus * a user conf...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/timer_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * timer test specific header * * Copyright (C) 2018, Google LLC */ #ifndef SELFTEST_KVM_TIMER_TEST_H #define SELFTEST_KVM_TIMER_TEST_H #include "kvm_util.h" #define NR_VCPUS_DEF 4 #define NR_TEST_ITERS_DEF 5 #define TIMER_TEST_PERIOD_MS_DEF ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/lru_gen_util' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Tools for integrating with lru_gen, like parsing the lru_gen debugfs output. * * Copyright (C) 2025, Google LLC. */ #ifndef SELFTEST_KVM_LRU_GEN_UTIL_H #define SELFTEST_KVM_LRU_GEN_UTIL_H #include <inttypes.h> #include <limits.h> #include <stdlib.h> #include "...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/userfaultfd_util' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * KVM userfaultfd util * * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ #include <inttypes.h> #include <time.h> #include <pthread.h> #include <linux/userfaultfd.h> #include "test_util.h" typedef int (*uffd_handler_t)(int uffd_mode, int u...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/test_util' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * tools/testing/selftests/kvm/include/test_util.h * * Copyright (C) 2018, Google LLC. */ #ifndef SELFTEST_KVM_TEST_UTIL_H #define SELFTEST_KVM_TEST_UTIL_H #include <setjmp.h> #include <signal.h> #include <stdlib.h> #include <stdarg.h> #include <stdbool.h> #inclu...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/ucall_common' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2018, Google LLC. */ #ifndef SELFTEST_KVM_UCALL_COMMON_H #define SELFTEST_KVM_UCALL_COMMON_H #include "test_util.h" #include "ucall.h" /* Common ucalls */ enum { UCALL_NONE, UCALL_SYNC, UCALL_ABORT, UCALL_PRINTF, UCALL_DONE, UCALL_UNHANDLED, }...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/numaif' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright (C) 2020, Google LLC. */ #ifndef SELFTEST_KVM_NUMAIF_H #define SELFTEST_KVM_NUMAIF_H #include <dirent.h> #include <linux/mempolicy.h> #include "kvm_syscalls.h" KVM_SYSCALL_DEFINE(get_mempolicy, 5, int *, policy, const unsigned long *, nmask, unsign...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/sparsebit' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * tools/testing/selftests/kvm/include/sparsebit.h * * Copyright (C) 2018, Google LLC. * * Header file that describes API to the sparsebit library. * This library provides a memory efficient means of storing * the settings of bits indexed via a u64. Memory usag...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/kvm_test_harness' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Macros for defining a KVM test * * Copyright (C) 2022, Google LLC. */ #ifndef SELFTEST_KVM_TEST_HARNESS_H #define SELFTEST_KVM_TEST_HARNESS_H #include "kselftest_harness.h" #define KVM_ONE_VCPU_TEST_SUITE(name) \ FIXTURE(name) { \ struct kvm_vcpu...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/kvm_syscalls' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_SYSCALLS_H #define SELFTEST_KVM_SYSCALLS_H #include <sys/syscall.h> #define MAP_ARGS0(m,...) #define MAP_ARGS1(m,t,a,...) m(t,a) #define MAP_ARGS2(m,t,a,...) m(t,a), MAP_ARGS1(m,__VA_ARGS__) #define MAP_ARGS3(m,t,a,...) m(t,a), MAP_ARGS2(m,__VA_ARG...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/kvm_util' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2018, Google LLC. */ #ifndef SELFTEST_KVM_UTIL_H #define SELFTEST_KVM_UTIL_H #include "test_util.h" #include <linux/compiler.h> #include "linux/hashtable.h" #include "linux/list.h" #include <linux/kernel.h> #include <linux/kvm.h> #include "linux/rb...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/memstress' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0 /* * tools/testing/selftests/kvm/include/memstress.h * * Copyright (C) 2020, Google LLC. */ #ifndef SELFTEST_KVM_MEMSTRESS_H #define SELFTEST_KVM_MEMSTRESS_H #include <pthread.h> #include "kvm_util.h" /* Default guest test virtual memory offset */ #define DEFAULT_GUEST_T...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/kvm_util_types' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UTIL_TYPES_H #define SELFTEST_KVM_UTIL_TYPES_H #include <linux/types.h> /* * Provide a version of static_assert() that is guaranteed to have an optional * message param. _GNU_SOURCE is defined for all KVM selftests, _GNU_SOURCE * implies _ISOC1...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/guest_modes' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2020, Red Hat, Inc. */ #include "kvm_util.h" struct guest_mode { bool supported; bool enabled; }; extern struct guest_mode guest_modes[NUM_VM_MODES]; #define guest_mode_append(mode, enabled) ({ \ guest_modes[mode] = (struct guest_mode){ (enabled), (...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/s390/ucall' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UCALL_H #define SELFTEST_KVM_UCALL_H #include "kvm_util.h" #define UCALL_EXIT_REASON KVM_EXIT_S390_SIEIC static inline void ucall_arch_init(struct kvm_vm *vm, gpa_t mmio_gpa) { } static inline void ucall_arch_do_ucall(gva_t uc) { /* Exit v...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/s390/facility' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright IBM Corp. 2024 * * Authors: * Hariharan Mari <hari55@linux.ibm.com> * * Get the facility bits with the STFLE instruction */ #ifndef SELFTEST_KVM_FACILITY_H #define SELFTEST_KVM_FACILITY_H #include <linux/bitops.h> /* alt_stfle_fac_list[16] + stf...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/s390/sie' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Definition for kernel virtual machines on s390. * * Adapted copy of struct definition kvm_s390_sie_block from * arch/s390/include/asm/kvm_host.h for use in userspace selftest programs. * * Copyright IBM Corp. 2008, 2024 * * Authors: * Christoph Schlameuss <schl...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/s390/kvm_util_arch' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UTIL_ARCH_H #define SELFTEST_KVM_UTIL_ARCH_H struct kvm_mmu_arch {}; struct kvm_vm_arch {}; #endif // SELFTEST_KVM_UTIL_ARCH_H ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/s390/processor' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * s390x processor specific defines */ #ifndef SELFTEST_KVM_PROCESSOR_H #define SELFTEST_KVM_PROCESSOR_H #include <linux/compiler.h> /* Bits in the region/segment table entry */ #define REGION_ENTRY_ORIGIN ~0xfffUL /* region/segment table origin */ #define REGIO...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/s390/diag318_test_handler' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-or-later * * Test handler for the s390x DIAGNOSE 0x0318 instruction. * * Copyright (C) 2020, IBM */ #ifndef SELFTEST_KVM_DIAG318_TEST_HANDLER #define SELFTEST_KVM_DIAG318_TEST_HANDLER u64 get_diag318_info(void); #endif ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/s390/debug_print' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Definition for kernel virtual machines on s390x * * Copyright IBM Corp. 2024 * * Authors: * Christoph Schlameuss <schlameuss@linux.ibm.com> */ #ifndef SELFTEST_KVM_DEBUG_PRINT_H #define SELFTEST_KVM_DEBUG_PRINT_H #include "asm/ptrace.h" #include "kvm_util....
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/loongarch/ucall' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UCALL_H #define SELFTEST_KVM_UCALL_H #include "kvm_util.h" #define UCALL_EXIT_REASON KVM_EXIT_MMIO /* * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each * VM), it must not be accessed from host code. */ extern g...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/loongarch/arch_timer' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * LoongArch Constant Timer specific interface */ #ifndef SELFTEST_KVM_ARCH_TIMER_H #define SELFTEST_KVM_ARCH_TIMER_H #include "processor.h" /* LoongArch timer frequency is constant 100MHZ */ #define TIMER_FREQ (100UL << 20) #define msec_to_cycles(msec) (TIMER_FREQ * (...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/loongarch/kvm_util_arch' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UTIL_ARCH_H #define SELFTEST_KVM_UTIL_ARCH_H struct kvm_mmu_arch {}; struct kvm_vm_arch {}; #endif // SELFTEST_KVM_UTIL_ARCH_H ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/loongarch/pmu' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * LoongArch PMU specific interface */ #ifndef SELFTEST_KVM_PMU_H #define SELFTEST_KVM_PMU_H #include "processor.h" #define LOONGARCH_CPUCFG6 0x6 #define CPUCFG6_PMP BIT(0) #define CPUCFG6_PAMVER GENMASK(3, 1) #define CPUCFG6_PMNUM GENMASK(7, 4) #defi...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/loongarch/processor' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_PROCESSOR_H #define SELFTEST_KVM_PROCESSOR_H #ifndef __ASSEMBLER__ #include "ucall_common.h" #else /* general registers */ #define zero $r0 #define ra $r1 #define tp $r2 #define sp $r3 #define a0 $r4 #define a1 $r5 #define a2 ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/ucall' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UCALL_H #define SELFTEST_KVM_UCALL_H #include "kvm_util.h" #define UCALL_EXIT_REASON KVM_EXIT_MMIO /* * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each * VM), it must not be accessed from host code. */ extern g...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/arch_timer' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * ARM Generic Timer specific interface */ #ifndef SELFTEST_KVM_ARCH_TIMER_H #define SELFTEST_KVM_ARCH_TIMER_H #include "processor.h" enum arch_timer { VIRTUAL, PHYSICAL, }; #define CTL_ENABLE (1 << 0) #define CTL_IMASK (1 << 1) #define CTL_ISTATUS (1 << 2) #define...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/gic_v3' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2013, 2014 ARM Limited, All Rights Reserved. * Author: Marc Zyngier <marc.zyngier@arm.com> */ #ifndef __SELFTESTS_GIC_V3_H #define __SELFTESTS_GIC_V3_H /* * Distributor registers. We assume we're running non-secure, with ARE * being set. Secure-o...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/gic' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * ARM Generic Interrupt Controller (GIC) specific defines */ #ifndef SELFTEST_KVM_GIC_H #define SELFTEST_KVM_GIC_H #include <asm/kvm.h> enum gic_type { GIC_V3, GIC_TYPE_MAX, }; /* * Note that the redistributor frames are at the end, as the range scales * with the...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/gic_v3_its' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef __SELFTESTS_GIC_V3_ITS_H__ #define __SELFTESTS_GIC_V3_ITS_H__ #include <linux/sizes.h> void its_init(gpa_t coll_tbl, size_t coll_tbl_sz, gpa_t device_tbl, size_t device_tbl_sz, gpa_t cmdq, size_t cmdq_size); void its_send_mapd_cmd(void *cmdq_base, u32 devic...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/gic_v5' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef __SELFTESTS_GIC_V5_H #define __SELFTESTS_GIC_V5_H #include <asm/barrier.h> #include <asm/sysreg.h> #include <linux/bitfield.h> #include "processor.h" /* * Definitions for GICv5 instructions for the Current Domain */ #define GICV5_OP_GIC_CDAFF sys_insn(1, ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/kvm_util_arch' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UTIL_ARCH_H #define SELFTEST_KVM_UTIL_ARCH_H struct kvm_mmu_arch {}; struct kvm_vm_arch { bool has_gic; int gic_fd; }; #endif // SELFTEST_KVM_UTIL_ARCH_H ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/vgic' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * ARM Generic Interrupt Controller (GIC) host specific defines */ #ifndef SELFTEST_KVM_VGIC_H #define SELFTEST_KVM_VGIC_H #include <linux/kvm.h> #include "kvm_util.h" #define REDIST_REGION_ATTR_ADDR(count, base, flags, index) \ (((u64)(count) << 52) | \ ((u64)((bas...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/processor' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * AArch64 processor specific defines * * Copyright (C) 2018, Red Hat, Inc. */ #ifndef SELFTEST_KVM_PROCESSOR_H #define SELFTEST_KVM_PROCESSOR_H #include "kvm_util.h" #include "ucall_common.h" #include <linux/stringify.h> #include <linux/types.h> #include <asm/brk-imm...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/spinlock' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef SELFTEST_KVM_ARM64_SPINLOCK_H #define SELFTEST_KVM_ARM64_SPINLOCK_H struct spinlock { int v; }; extern void spin_lock(struct spinlock *lock); extern void spin_unlock(struct spinlock *lock); #endif /* SELFTEST_KVM_ARM64_SPINLOCK_H */ ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/arm64/delay' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * ARM simple delay routines */ #ifndef SELFTEST_KVM_ARM_DELAY_H #define SELFTEST_KVM_ARM_DELAY_H #include "arch_timer.h" static inline void __delay(u64 cycles) { enum arch_timer timer = VIRTUAL; u64 start = timer_get_cntct(timer); while ((timer_get_cntct(timer) - ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/ucall' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UCALL_H #define SELFTEST_KVM_UCALL_H #include "kvm_util.h" #define UCALL_EXIT_REASON KVM_EXIT_IO static inline void ucall_arch_init(struct kvm_vm *vm, gpa_t mmio_gpa) { } #endif ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/svm' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef SELFTEST_KVM_SVM_H #define SELFTEST_KVM_SVM_H enum { INTERCEPT_INTR, INTERCEPT_NMI, INTERCEPT_SMI, INTERCEPT_INIT, INTERCEPT_VINTR, INTERCEPT_SELECTIVE_CR0, INTERCEPT_STORE_IDTR, INTERCEPT_STORE_GDTR, INTERCEPT_STORE_LDTR, INTERCEPT_STORE_TR, INTERCEPT_LOA...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/svm_util' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2020, Red Hat, Inc. */ #ifndef SELFTEST_KVM_SVM_UTILS_H #define SELFTEST_KVM_SVM_UTILS_H #include <asm/svm.h> #include <stdint.h> #include "svm.h" #include "processor.h" struct svm_test_data { /* VMCB */ struct vmcb *vmcb; /* gva */ void *vmcb...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/mce' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2022, Google LLC. */ #ifndef SELFTEST_KVM_MCE_H #define SELFTEST_KVM_MCE_H #define MCG_CTL_P BIT_ULL(8) /* MCG_CTL register available */ #define MCG_SER_P BIT_ULL(24) /* MCA recovery/new status bits */ #define MCG_LMCE_P BIT_ULL(27) /* Local...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/sev' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Helpers used for SEV guests * */ #ifndef SELFTEST_KVM_SEV_H #define SELFTEST_KVM_SEV_H #include <stdint.h> #include <stdbool.h> #include "linux/psp-sev.h" #include "kvm_util.h" #include "svm_util.h" #include "processor.h" enum sev_guest_state { SEV_GUEST_STA...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/evmcs' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2018, Red Hat, Inc. */ #ifndef SELFTEST_KVM_EVMCS_H #define SELFTEST_KVM_EVMCS_H #include <stdint.h> #include "hyperv.h" #include "vmx.h" #define u16 u16 #define u32 u32 #define u64 u64 #define EVMCS_VERSION 1 extern bool enable_evmcs; struct hv_enl...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/apic' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2021, Google LLC. */ #ifndef SELFTEST_KVM_APIC_H #define SELFTEST_KVM_APIC_H #include <stdint.h> #include "processor.h" #include "ucall_common.h" #define APIC_DEFAULT_GPA 0xfee00000ULL /* APIC base address MSR and fields */ #define MSR_IA32_API...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/kvm_util_arch' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UTIL_ARCH_H #define SELFTEST_KVM_UTIL_ARCH_H #include <stdbool.h> #include <stdint.h> #include "kvm_util_types.h" #include "test_util.h" extern bool is_forced_emulation_enabled; struct pte_masks { u64 present; u64 writable; u64 user; u64 read...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/pmu' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2023, Tencent, Inc. */ #ifndef SELFTEST_KVM_PMU_H #define SELFTEST_KVM_PMU_H #include <stdbool.h> #include <linux/types.h> #include <linux/bits.h> #define KVM_PMU_EVENT_FILTER_MAX_EVENTS 300 /* * Encode an eventsel+umask pair into event-select...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/vmx' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2018, Google LLC. */ #ifndef SELFTEST_KVM_VMX_H #define SELFTEST_KVM_VMX_H #include <asm/vmx.h> #include <stdint.h> #include "processor.h" #include "apic.h" /* * Definitions of Primary Processor-Based VM-Execution Controls. */ #define CPU_BASED...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/processor' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2018, Google LLC. */ #ifndef SELFTEST_KVM_PROCESSOR_H #define SELFTEST_KVM_PROCESSOR_H #include <assert.h> #include <stdint.h> #include <syscall.h> #include <asm/msr-index.h> #include <asm/prctl.h> #include <linux/kvm_para.h> #include <linux/stri...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/hyperv' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2021, Red Hat, Inc. */ #ifndef SELFTEST_KVM_HYPERV_H #define SELFTEST_KVM_HYPERV_H #include "processor.h" #define HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS 0x40000000 #define HYPERV_CPUID_INTERFACE 0x40000001 #define HYPERV_CPUID_VERSION 0x40000002 #de...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/x86/smm' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only #ifndef SELFTEST_KVM_SMM_H #define SELFTEST_KVM_SMM_H #include "kvm_util.h" #define SMRAM_SIZE 65536 #define SMRAM_MEMSLOT ((1 << 16) | 1) #define SMRAM_PAGES (SMRAM_SIZE / PAGE_SIZE) void setup_smram(struct kvm_vm *vm, struct kvm_vcpu *vcpu, u64 smram_gpa, const void...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/riscv/ucall' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UCALL_H #define SELFTEST_KVM_UCALL_H #include "processor.h" #include "sbi.h" #define UCALL_EXIT_REASON KVM_EXIT_RISCV_SBI static inline void ucall_arch_init(struct kvm_vm *vm, gpa_t mmio_gpa) { } static inline void ucall_arch_do_ucall(gva_t...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/riscv/arch_timer' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * RISC-V Arch Timer(sstc) specific interface * * Copyright (c) 2024 Intel Corporation */ #ifndef SELFTEST_KVM_ARCH_TIMER_H #define SELFTEST_KVM_ARCH_TIMER_H #include <asm/csr.h> #include <asm/vdso/processor.h> static unsigned long timer_freq; #define msec_to_cycles...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/riscv/kvm_util_arch' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_KVM_UTIL_ARCH_H #define SELFTEST_KVM_UTIL_ARCH_H struct kvm_mmu_arch {}; struct kvm_vm_arch {}; #endif // SELFTEST_KVM_UTIL_ARCH_H ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/riscv/processor' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * RISC-V processor specific defines * * Copyright (C) 2021 Western Digital Corporation or its affiliates. */ #ifndef SELFTEST_KVM_PROCESSOR_H #define SELFTEST_KVM_PROCESSOR_H #include <linux/stringify.h> #include <asm/csr.h> #include <asm/vdso/processor.h> #include "k...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/include/riscv/sbi' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * RISC-V SBI specific definitions * * Copyright (C) 2024 Rivos Inc. */ #ifndef SELFTEST_KVM_SBI_H #define SELFTEST_KVM_SBI_H /* SBI spec version fields */ #define SBI_SPEC_VERSION_DEFAULT 0x1 #define SBI_SPEC_VERSION_MAJOR_SHIFT 24 #define SBI_SPEC_VERSION_MAJOR_MASK...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/userfaultfd_util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * KVM userfaultfd util * Adapted from demand_paging_test.c * * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <poll.h> #include <pthread.h> #include <linux...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/ucall_common' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include "linux/types.h" #include "linux/bitmap.h" #include "linux/atomic.h" #include "kvm_util.h" #include "ucall_common.h" #define GUEST_UCALL_FAILED -1 struct ucall_header { DECLARE_BITMAP(in_use, KVM_MAX_VCPUS); struct ucall ucalls[KVM_MAX_VCPUS]; }; int ucall_nr...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/sparsebit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Sparse bit array * * Copyright (C) 2018, Google LLC. * Copyright (C) 2018, Red Hat, Inc. (code style cleanup and fuzzing driver) * * This library provides functions to support a memory efficient bit array, * with an index size of 2^64. A sparsebit array is allo...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/string_override' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <stddef.h> /* * Override the "basic" built-in string helpers so that they can be used in * guest code. KVM selftests don't support dynamic loading in guest code and * will jump into the weeds if the compiler decides to insert an out-of-line * call via the PLT...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/kvm_util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * tools/testing/selftests/kvm/lib/kvm_util.c * * Copyright (C) 2018, Google LLC. */ #include "test_util.h" #include "kvm_util.h" #include "processor.h" #include "ucall_common.h" #include <assert.h> #include <sched.h> #include <sys/mman.h> #include <sys/resource.h> #...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/test_util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * tools/testing/selftests/kvm/lib/test_util.c * * Copyright (C) 2020, Google LLC. */ #include <stdio.h> #include <stdarg.h> #include <assert.h> #include <ctype.h> #include <limits.h> #include <stdlib.h> #include <time.h> #include <sys/stat.h> #include <sys/syscall.h>...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/guest_sprintf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include "test_util.h" #include "kvm_util.h" #include "ucall_common.h" #define APPEND_BUFFER_SAFE(str, end, v) \ do { \ GUEST_ASSERT(str < end); \ *str++ = (v); \ } while (0) static int isdigit(int ch) { return (ch >= '0') && (ch <= '9'); } static int skip_atoi(...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/lru_gen_util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2025, Google LLC. */ #include <time.h> #include "lru_gen_util.h" /* * Tracks state while we parse memcg lru_gen stats. The file we're parsing is * structured like this (some extra whitespace elided): * * memcg (id) (path) * node (id) * (gen_nr)...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/assert' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * tools/testing/selftests/kvm/lib/assert.c * * Copyright (C) 2018, Google LLC. */ #include "test_util.h" #include <execinfo.h> #include <sys/syscall.h> #include "kselftest.h" /* Dumps the current stack trace to stderr. */ static void __attribute__((noinline)) test...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/elf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * tools/testing/selftests/kvm/lib/elf.c * * Copyright (C) 2018, Google LLC. */ #include "test_util.h" #include <endian.h> #include <linux/elf.h> #include "kvm_util.h" static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp) { off_t offset_rv; /* Open the...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/io' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * tools/testing/selftests/kvm/lib/io.c * * Copyright (C) 2018, Google LLC. */ #include "test_util.h" /* Test Write * * A wrapper for write(2), that automatically handles the following * special conditions: * * + Interrupted system call (EINTR) * + Write o...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/guest_modes' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2020, Red Hat, Inc. */ #include "guest_modes.h" #if defined(__aarch64__) || defined(__riscv) #include "processor.h" enum vm_guest_mode vm_mode_default; #endif struct guest_mode guest_modes[NUM_VM_MODES]; void guest_modes_append_default(void) { #if !define...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/memstress' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2020, Google LLC. */ #include <inttypes.h> #include <linux/bitmap.h> #include "kvm_util.h" #include "memstress.h" #include "processor.h" #include "ucall_common.h" struct memstress_args memstress_args; /* * Guest virtual memory offset of the testing memor...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/s390/processor' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * KVM selftest s390x library code - CPU-related functions (page tables...) * * Copyright (C) 2019, Red Hat, Inc. */ #include "processor.h" #include "kvm_util.h" #define PAGES_PER_REGION 4 void virt_arch_pgd_alloc(struct kvm_vm *vm) { gpa_t gpa; TEST_ASSERT(vm->...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/s390/ucall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ucall support. A ucall is a "hypercall to userspace". * * Copyright (C) 2019 Red Hat, Inc. */ #include "kvm_util.h" void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu) { struct kvm_run *run = vcpu->run; if (run->exit_reason == KVM_EXIT_S390_SIEIC && run->s390_sie...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/s390/facility' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright IBM Corp. 2024 * * Authors: * Hariharan Mari <hari55@linux.ibm.com> * * Contains the definition for the global variables to have the test facitlity feature. */ #include "facility.h" u64 stfl_doublewords[NB_STFL_DOUBLEWORDS]; bool stfle_flag; ```
Linux kernel'inin 'tools/testing/selftests/kvm/lib/s390/diag318_test_handler' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Test handler for the s390x DIAGNOSE 0x0318 instruction. * * Copyright (C) 2020, IBM */ #include "test_util.h" #include "kvm_util.h" #define ICPT_INSTRUCTION 0x04 #define IPA0_DIAG 0x8300 static void guest_code(void) { u64 diag318_info = 0x12345678; asm v...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/loongarch/processor' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <assert.h> #include <linux/compiler.h> #include <asm/kvm.h> #include "kvm_util.h" #include "pmu.h" #include "processor.h" #include "ucall_common.h" #define LOONGARCH_PAGE_TABLE_PHYS_MIN 0x200000 #define LOONGARCH_GUEST_STACK_VADDR_MIN 0x200000 static gpa_t invalid...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/loongarch/ucall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ucall support. A ucall is a "hypercall to userspace". * */ #include "kvm_util.h" /* * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each * VM), it must not be accessed from host code. */ gva_t *ucall_exit_mmio_addr; void ucall_arch_init(stru...
Linux kernel'inde 'tools/testing/selftests/kvm/lib/loongarch/exception' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0 */ #include "processor.h" /* address of refill exception should be 4K aligned */ .balign 4096 .global handle_tlb_refill handle_tlb_refill: csrwr t0, LOONGARCH_CSR_TLBRSAVE csrrd t0, LOONGARCH_CSR_PGD lddir t0, t0, 3 lddir t0, t0, 1 ldpte t0, 0 ldpte t0, 1 tlbfill...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/arm64/gic' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ARM Generic Interrupt Controller (GIC) support */ #include <errno.h> #include <linux/bits.h> #include <linux/sizes.h> #include "kvm_util.h" #include <gic.h> #include "gic_private.h" #include "processor.h" #include "spinlock.h" static const struct gic_common_ops *gic_c...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/arm64/processor' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * AArch64 code * * Copyright (C) 2018, Red Hat, Inc. */ #include <linux/compiler.h> #include <assert.h> #include "guest_modes.h" #include "kvm_util.h" #include "processor.h" #include "ucall_common.h" #include "vgic.h" #include <linux/bitfield.h> #include <linux/sizes.h...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/arm64/spinlock' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ARM64 Spinlock support */ #include <stdint.h> #include "spinlock.h" void spin_lock(struct spinlock *lock) { int val, res; asm volatile( "1: ldaxr %w0, [%2]\n" " cbnz %w0, 1b\n" " mov %w0, #1\n" " stxr %w1, %w0, [%2]\n" " cbnz %w1, 1b\n" : "=&r" (val), "=&r" (re...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/arm64/gic_v3_its' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Guest ITS library, generously donated by drivers/irqchip/irq-gic-v3-its.c * over in the kernel tree. */ #include <linux/kvm.h> #include <linux/sizes.h> #include <asm/kvm_para.h> #include <asm/kvm.h> #include "kvm_util.h" #include "vgic.h" #include "gic.h" #include "gic...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/kvm/lib/arm64/gic_private' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * ARM Generic Interrupt Controller (GIC) private defines that's only * shared among the GIC library code. */ #ifndef SELFTEST_KVM_GIC_PRIVATE_H #define SELFTEST_KVM_GIC_PRIVATE_H struct gic_common_ops { void (*gic_init)(unsigned int nr_cpus); void (*gic_cpu_init)(un...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/arm64/ucall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ucall support. A ucall is a "hypercall to userspace". * * Copyright (C) 2018, Red Hat, Inc. */ #include "kvm_util.h" gva_t *ucall_exit_mmio_addr; void ucall_arch_init(struct kvm_vm *vm, gpa_t mmio_gpa) { gva_t mmio_gva = vm_unused_gva_gap(vm, vm->page_size, KVM_UTIL_...
Linux kernel'inde 'tools/testing/selftests/kvm/lib/arm64/handlers' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0 */ .macro save_registers add sp, sp, #-16 * 17 stp x0, x1, [sp, #16 * 0] stp x2, x3, [sp, #16 * 1] stp x4, x5, [sp, #16 * 2] stp x6, x7, [sp, #16 * 3] stp x8, x9, [sp, #16 * 4] stp x10, x11, [sp, #16 * 5] stp x12, x13, [sp, #16 * 6] stp x14, x15, [sp, #16 * 7] ...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/arm64/vgic' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ARM Generic Interrupt Controller (GIC) v3 host support */ #include <linux/kernel.h> #include <linux/kvm.h> #include <linux/sizes.h> #include <asm/cputype.h> #include <asm/kvm_para.h> #include <asm/kvm.h> #include "kvm_util.h" #include "vgic.h" #include "gic.h" #include ...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/arm64/gic_v3' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ARM Generic Interrupt Controller (GIC) v3 support */ #include <linux/sizes.h> #include "kvm_util.h" #include "processor.h" #include "delay.h" #include "gic.h" #include "gic_v3.h" #include "gic_private.h" #define GICV3_MAX_CPUS 512 #define GICD_INT_DEF_PRI 0xa0 #de...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/x86/svm' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Helpers used for nested SVM testing * Largely inspired from KVM unit test svm.c * * Copyright (C) 2020, Red Hat, Inc. */ #include "test_util.h" #include "kvm_util.h" #include "processor.h" #include "svm_util.h" #define SEV_DEV_PATH "/dev/sev" struct gpr64_regs ...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/x86/pmu' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2023, Tencent, Inc. */ #include <stdint.h> #include <linux/kernel.h> #include "kvm_util.h" #include "processor.h" #include "pmu.h" const u64 intel_pmu_arch_events[] = { INTEL_ARCH_CPU_CYCLES, INTEL_ARCH_INSTRUCTIONS_RETIRED, INTEL_ARCH_REFERENCE_...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/x86/processor' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2018, Google LLC. */ #include "linux/bitmap.h" #include "test_util.h" #include "kvm_util.h" #include "pmu.h" #include "processor.h" #include "smm.h" #include "svm_util.h" #include "sev.h" #include "vmx.h" #ifndef NUM_INTERRUPTS #define NUM_INTERRUPTS ...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/x86/ucall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ucall support. A ucall is a "hypercall to userspace". * * Copyright (C) 2018, Red Hat, Inc. */ #include "kvm_util.h" #define UCALL_PIO_PORT ((u16)0x1000) void ucall_arch_do_ucall(gva_t uc) { /* * FIXME: Revert this hack (the entire commit that added it) once nVMX ...
Linux kernel'inde 'tools/testing/selftests/kvm/lib/x86/handlers' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly handle_exception: push %r15 push %r14 push %r13 push %r12 push %r11 push %r10 push %r9 push %r8 push %rdi push %rsi push %rbp push %rbx push %rdx push %rcx push %rax mov %rsp, %rdi call route_exception pop %rax pop %rcx pop %rdx pop %rbx pop %rbp pop %rsi pop %rdi pop %r8 pop %r...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/x86/apic' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2021, Google LLC. */ #include "apic.h" void apic_disable(void) { wrmsr(MSR_IA32_APICBASE, rdmsr(MSR_IA32_APICBASE) & ~(MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_EXTD)); } void xapic_enable(void) { u64 val = rdmsr(MSR_IA32_APICBASE); /...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/x86/sev' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <stdint.h> #include <stdbool.h> #include "sev.h" /* * sparsebit_next_clear() can return 0 if [x, 2**64-1] are all set, and the * -1 would then cause an underflow back to 2**64 - 1. This is expected and * correct. * * If the last range in the sparsebit is [x,...
Linux kernel'inin 'tools/testing/selftests/kvm/lib/x86/hyperv' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Hyper-V specific functions. * * Copyright (C) 2021, Red Hat Inc. */ #include <stdint.h> #include "processor.h" #include "hyperv.h" const struct kvm_cpuid2 *kvm_get_supported_hv_cpuid(void) { static struct kvm_cpuid2 *cpuid; int kvm_fd; if (cpuid) return cpui...