Path: blob/master/tools/testing/selftests/kvm/include/s390/processor.h
49000 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* s390x processor specific defines3*/4#ifndef SELFTEST_KVM_PROCESSOR_H5#define SELFTEST_KVM_PROCESSOR_H67#include <linux/compiler.h>89/* Bits in the region/segment table entry */10#define REGION_ENTRY_ORIGIN ~0xfffUL /* region/segment table origin */11#define REGION_ENTRY_PROTECT 0x200 /* region protection bit */12#define REGION_ENTRY_NOEXEC 0x100 /* region no-execute bit */13#define REGION_ENTRY_OFFSET 0xc0 /* region table offset */14#define REGION_ENTRY_INVALID 0x20 /* invalid region table entry */15#define REGION_ENTRY_TYPE 0x0c /* region/segment table type mask */16#define REGION_ENTRY_LENGTH 0x03 /* region third length */1718/* Bits in the page table entry */19#define PAGE_INVALID 0x400 /* HW invalid bit */20#define PAGE_PROTECT 0x200 /* HW read-only bit */21#define PAGE_NOEXEC 0x100 /* HW no-execute bit */2223/* Page size definitions */24#define PAGE_SHIFT 1225#define PAGE_SIZE BIT_ULL(PAGE_SHIFT)26#define PAGE_MASK (~(PAGE_SIZE - 1))2728/* Is there a portable way to do this? */29static inline void cpu_relax(void)30{31barrier();32}3334/* Get the instruction length */35static inline int insn_length(unsigned char code)36{37return ((((int)code + 64) >> 7) + 1) << 1;38}3940#endif414243