mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
linux-headers: update to v6.5-rc1
Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
@@ -656,6 +656,49 @@ extern "C" {
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC fourcc_mod_code(INTEL, 12)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surfaces (CCS) for display ver. 14 render compression.
|
||||
*
|
||||
* The main surface is tile4 and at plane index 0, the CCS is linear and
|
||||
* at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
|
||||
* main surface. In other words, 4 bits in CCS map to a main surface cache
|
||||
* line pair. The main surface pitch is required to be a multiple of four
|
||||
* tile4 widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS fourcc_mod_code(INTEL, 13)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surfaces (CCS) for display ver. 14 media compression
|
||||
*
|
||||
* The main surface is tile4 and at plane index 0, the CCS is linear and
|
||||
* at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
|
||||
* main surface. In other words, 4 bits in CCS map to a main surface cache
|
||||
* line pair. The main surface pitch is required to be a multiple of four
|
||||
* tile4 widths. For semi-planar formats like NV12, CCS planes follow the
|
||||
* Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces,
|
||||
* planes 2 and 3 for the respective CCS.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_MTL_MC_CCS fourcc_mod_code(INTEL, 14)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surface with Clear Color (CCS) for display ver. 14 render
|
||||
* compression.
|
||||
*
|
||||
* The main surface is tile4 and is at plane index 0 whereas CCS is linear
|
||||
* and at index 1. The clear color is stored at index 2, and the pitch should
|
||||
* be ignored. The clear color structure is 256 bits. The first 128 bits
|
||||
* represents Raw Clear Color Red, Green, Blue and Alpha color each represented
|
||||
* by 32 bits. The raw clear color is consumed by the 3d engine and generates
|
||||
* the converted clear color of size 64 bits. The first 32 bits store the Lower
|
||||
* Converted Clear Color value and the next 32 bits store the Higher Converted
|
||||
* Clear Color value when applicable. The Converted Clear Color values are
|
||||
* consumed by the DE. The last 64 bits are used to store Color Discard Enable
|
||||
* and Depth Clear Value Valid which are ignored by the DE. A CCS cache line
|
||||
* corresponds to an area of 4x1 tiles in the main surface. The main surface
|
||||
* pitch is required to be a multiple of 4 tile widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15)
|
||||
|
||||
/*
|
||||
* Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
|
||||
*
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#define _BITUL(x) (_UL(1) << (x))
|
||||
#define _BITULL(x) (_ULL(1) << (x))
|
||||
|
||||
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
|
||||
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
|
||||
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
|
||||
|
||||
#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
|
||||
|
||||
@@ -738,6 +738,7 @@
|
||||
#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
|
||||
#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
|
||||
#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
|
||||
#define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */
|
||||
#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
|
||||
#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
|
||||
|
||||
|
||||
@@ -47,6 +47,22 @@ struct vhost_vring_addr {
|
||||
uint64_t log_guest_addr;
|
||||
};
|
||||
|
||||
struct vhost_worker_state {
|
||||
/*
|
||||
* For VHOST_NEW_WORKER the kernel will return the new vhost_worker id.
|
||||
* For VHOST_FREE_WORKER this must be set to the id of the vhost_worker
|
||||
* to free.
|
||||
*/
|
||||
unsigned int worker_id;
|
||||
};
|
||||
|
||||
struct vhost_vring_worker {
|
||||
/* vring index */
|
||||
unsigned int index;
|
||||
/* The id of the vhost_worker returned from VHOST_NEW_WORKER */
|
||||
unsigned int worker_id;
|
||||
};
|
||||
|
||||
/* no alignment requirement */
|
||||
struct vhost_iotlb_msg {
|
||||
uint64_t iova;
|
||||
|
||||
@@ -138,11 +138,11 @@ struct virtio_blk_config {
|
||||
|
||||
/* Zoned block device characteristics (if VIRTIO_BLK_F_ZONED) */
|
||||
struct virtio_blk_zoned_characteristics {
|
||||
uint32_t zone_sectors;
|
||||
uint32_t max_open_zones;
|
||||
uint32_t max_active_zones;
|
||||
uint32_t max_append_sectors;
|
||||
uint32_t write_granularity;
|
||||
__virtio32 zone_sectors;
|
||||
__virtio32 max_open_zones;
|
||||
__virtio32 max_active_zones;
|
||||
__virtio32 max_append_sectors;
|
||||
__virtio32 write_granularity;
|
||||
uint8_t model;
|
||||
uint8_t unused2[3];
|
||||
} zoned;
|
||||
@@ -239,11 +239,11 @@ struct virtio_blk_outhdr {
|
||||
*/
|
||||
struct virtio_blk_zone_descriptor {
|
||||
/* Zone capacity */
|
||||
uint64_t z_cap;
|
||||
__virtio64 z_cap;
|
||||
/* The starting sector of the zone */
|
||||
uint64_t z_start;
|
||||
__virtio64 z_start;
|
||||
/* Zone write pointer position in sectors */
|
||||
uint64_t z_wp;
|
||||
__virtio64 z_wp;
|
||||
/* Zone type */
|
||||
uint8_t z_type;
|
||||
/* Zone state */
|
||||
@@ -252,7 +252,7 @@ struct virtio_blk_zone_descriptor {
|
||||
};
|
||||
|
||||
struct virtio_blk_zone_report {
|
||||
uint64_t nr_zones;
|
||||
__virtio64 nr_zones;
|
||||
uint8_t reserved[56];
|
||||
struct virtio_blk_zone_descriptor zones[];
|
||||
};
|
||||
|
||||
@@ -97,6 +97,12 @@
|
||||
*/
|
||||
#define VIRTIO_F_SR_IOV 37
|
||||
|
||||
/*
|
||||
* This feature indicates that the driver passes extra data (besides
|
||||
* identifying the virtqueue) in its device notifications.
|
||||
*/
|
||||
#define VIRTIO_F_NOTIFICATION_DATA 38
|
||||
|
||||
/*
|
||||
* This feature indicates that the driver can reset a queue individually.
|
||||
*/
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#define VIRTIO_NET_F_GUEST_USO6 55 /* Guest can handle USOv6 in. */
|
||||
#define VIRTIO_NET_F_HOST_USO 56 /* Host can handle USO in. */
|
||||
#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */
|
||||
#define VIRTIO_NET_F_GUEST_HDRLEN 59 /* Guest provides the exact hdr_len value. */
|
||||
#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
|
||||
#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
|
||||
#define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device
|
||||
|
||||
@@ -1,24 +1 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* Copyright (C) 2012 ARM Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __ASM_BITSPERLONG_H
|
||||
#define __ASM_BITSPERLONG_H
|
||||
|
||||
#define __BITS_PER_LONG 64
|
||||
|
||||
#include <asm-generic/bitsperlong.h>
|
||||
|
||||
#endif /* __ASM_BITSPERLONG_H */
|
||||
|
||||
@@ -198,6 +198,15 @@ struct kvm_arm_copy_mte_tags {
|
||||
__u64 reserved[2];
|
||||
};
|
||||
|
||||
/*
|
||||
* Counter/Timer offset structure. Describe the virtual/physical offset.
|
||||
* To be used with KVM_ARM_SET_COUNTER_OFFSET.
|
||||
*/
|
||||
struct kvm_arm_counter_offset {
|
||||
__u64 counter_offset;
|
||||
__u64 reserved;
|
||||
};
|
||||
|
||||
#define KVM_ARM_TAGS_TO_GUEST 0
|
||||
#define KVM_ARM_TAGS_FROM_GUEST 1
|
||||
|
||||
@@ -363,6 +372,10 @@ enum {
|
||||
KVM_REG_ARM_VENDOR_HYP_BIT_PTP = 1,
|
||||
};
|
||||
|
||||
/* Device Control API on vm fd */
|
||||
#define KVM_ARM_VM_SMCCC_CTRL 0
|
||||
#define KVM_ARM_VM_SMCCC_FILTER 0
|
||||
|
||||
/* Device Control API: ARM VGIC */
|
||||
#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
|
||||
#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
|
||||
@@ -402,6 +415,8 @@ enum {
|
||||
#define KVM_ARM_VCPU_TIMER_CTRL 1
|
||||
#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
|
||||
#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
|
||||
#define KVM_ARM_VCPU_TIMER_IRQ_HVTIMER 2
|
||||
#define KVM_ARM_VCPU_TIMER_IRQ_HPTIMER 3
|
||||
#define KVM_ARM_VCPU_PVTIME_CTRL 2
|
||||
#define KVM_ARM_VCPU_PVTIME_IPA 0
|
||||
|
||||
@@ -458,6 +473,24 @@ enum {
|
||||
/* run->fail_entry.hardware_entry_failure_reason codes. */
|
||||
#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)
|
||||
|
||||
enum kvm_smccc_filter_action {
|
||||
KVM_SMCCC_FILTER_HANDLE = 0,
|
||||
KVM_SMCCC_FILTER_DENY,
|
||||
KVM_SMCCC_FILTER_FWD_TO_USER,
|
||||
|
||||
};
|
||||
|
||||
struct kvm_smccc_filter {
|
||||
__u32 base;
|
||||
__u32 nr_functions;
|
||||
__u8 action;
|
||||
__u8 pad[15];
|
||||
};
|
||||
|
||||
/* arm64-specific KVM_EXIT_HYPERCALL flags */
|
||||
#define KVM_HYPERCALL_EXIT_SMC (1U << 0)
|
||||
#define KVM_HYPERCALL_EXIT_16BIT (1U << 1)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __ARM_KVM_H__ */
|
||||
|
||||
@@ -2,6 +2,17 @@
|
||||
#ifndef __ASM_GENERIC_BITS_PER_LONG
|
||||
#define __ASM_GENERIC_BITS_PER_LONG
|
||||
|
||||
#ifndef __BITS_PER_LONG
|
||||
/*
|
||||
* In order to keep safe and avoid regression, only unify uapi
|
||||
* bitsperlong.h for some archs which are using newer toolchains
|
||||
* that have the definitions of __CHAR_BIT__ and __SIZEOF_LONG__.
|
||||
* See the following link for more info:
|
||||
* https://lore.kernel.org/linux-arch/b9624545-2c80-49a1-ac3c-39264a591f7b@app.fastmail.com/
|
||||
*/
|
||||
#if defined(__CHAR_BIT__) && defined(__SIZEOF_LONG__)
|
||||
#define __BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
|
||||
#else
|
||||
/*
|
||||
* There seems to be no way of detecting this automatically from user
|
||||
* space, so 64 bit architectures should override this in their
|
||||
@@ -9,8 +20,8 @@
|
||||
* both 32 and 64 bit user space must not rely on CONFIG_64BIT
|
||||
* to decide it, but rather check a compiler provided macro.
|
||||
*/
|
||||
#ifndef __BITS_PER_LONG
|
||||
#define __BITS_PER_LONG 32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_BITS_PER_LONG */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -379,5 +379,6 @@
|
||||
#define __NR_process_mrelease (__NR_Linux + 448)
|
||||
#define __NR_futex_waitv (__NR_Linux + 449)
|
||||
#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
|
||||
#define __NR_cachestat (__NR_Linux + 451)
|
||||
|
||||
#endif /* _ASM_UNISTD_N32_H */
|
||||
|
||||
@@ -355,5 +355,6 @@
|
||||
#define __NR_process_mrelease (__NR_Linux + 448)
|
||||
#define __NR_futex_waitv (__NR_Linux + 449)
|
||||
#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
|
||||
#define __NR_cachestat (__NR_Linux + 451)
|
||||
|
||||
#endif /* _ASM_UNISTD_N64_H */
|
||||
|
||||
@@ -425,5 +425,6 @@
|
||||
#define __NR_process_mrelease (__NR_Linux + 448)
|
||||
#define __NR_futex_waitv (__NR_Linux + 449)
|
||||
#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
|
||||
#define __NR_cachestat (__NR_Linux + 451)
|
||||
|
||||
#endif /* _ASM_UNISTD_O32_H */
|
||||
|
||||
@@ -432,6 +432,7 @@
|
||||
#define __NR_process_mrelease 448
|
||||
#define __NR_futex_waitv 449
|
||||
#define __NR_set_mempolicy_home_node 450
|
||||
#define __NR_cachestat 451
|
||||
|
||||
|
||||
#endif /* _ASM_UNISTD_32_H */
|
||||
|
||||
@@ -404,6 +404,7 @@
|
||||
#define __NR_process_mrelease 448
|
||||
#define __NR_futex_waitv 449
|
||||
#define __NR_set_mempolicy_home_node 450
|
||||
#define __NR_cachestat 451
|
||||
|
||||
|
||||
#endif /* _ASM_UNISTD_64_H */
|
||||
|
||||
@@ -1,14 +1 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
||||
/*
|
||||
* Copyright (C) 2012 ARM Ltd.
|
||||
* Copyright (C) 2015 Regents of the University of California
|
||||
*/
|
||||
|
||||
#ifndef _ASM_RISCV_BITSPERLONG_H
|
||||
#define _ASM_RISCV_BITSPERLONG_H
|
||||
|
||||
#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8)
|
||||
|
||||
#include <asm-generic/bitsperlong.h>
|
||||
|
||||
#endif /* _ASM_RISCV_BITSPERLONG_H */
|
||||
|
||||
@@ -12,8 +12,10 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/bitsperlong.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
#define __KVM_HAVE_IRQ_LINE
|
||||
#define __KVM_HAVE_READONLY_MEM
|
||||
|
||||
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
|
||||
@@ -52,6 +54,7 @@ struct kvm_riscv_config {
|
||||
unsigned long mvendorid;
|
||||
unsigned long marchid;
|
||||
unsigned long mimpid;
|
||||
unsigned long zicboz_block_size;
|
||||
};
|
||||
|
||||
/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
|
||||
@@ -64,7 +67,7 @@ struct kvm_riscv_core {
|
||||
#define KVM_RISCV_MODE_S 1
|
||||
#define KVM_RISCV_MODE_U 0
|
||||
|
||||
/* CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
|
||||
/* General CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
|
||||
struct kvm_riscv_csr {
|
||||
unsigned long sstatus;
|
||||
unsigned long sie;
|
||||
@@ -78,6 +81,17 @@ struct kvm_riscv_csr {
|
||||
unsigned long scounteren;
|
||||
};
|
||||
|
||||
/* AIA CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
|
||||
struct kvm_riscv_aia_csr {
|
||||
unsigned long siselect;
|
||||
unsigned long iprio1;
|
||||
unsigned long iprio2;
|
||||
unsigned long sieh;
|
||||
unsigned long siph;
|
||||
unsigned long iprio1h;
|
||||
unsigned long iprio2h;
|
||||
};
|
||||
|
||||
/* TIMER registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
|
||||
struct kvm_riscv_timer {
|
||||
__u64 frequency;
|
||||
@@ -105,9 +119,31 @@ enum KVM_RISCV_ISA_EXT_ID {
|
||||
KVM_RISCV_ISA_EXT_SVINVAL,
|
||||
KVM_RISCV_ISA_EXT_ZIHINTPAUSE,
|
||||
KVM_RISCV_ISA_EXT_ZICBOM,
|
||||
KVM_RISCV_ISA_EXT_ZICBOZ,
|
||||
KVM_RISCV_ISA_EXT_ZBB,
|
||||
KVM_RISCV_ISA_EXT_SSAIA,
|
||||
KVM_RISCV_ISA_EXT_V,
|
||||
KVM_RISCV_ISA_EXT_SVNAPOT,
|
||||
KVM_RISCV_ISA_EXT_MAX,
|
||||
};
|
||||
|
||||
/*
|
||||
* SBI extension IDs specific to KVM. This is not the same as the SBI
|
||||
* extension IDs defined by the RISC-V SBI specification.
|
||||
*/
|
||||
enum KVM_RISCV_SBI_EXT_ID {
|
||||
KVM_RISCV_SBI_EXT_V01 = 0,
|
||||
KVM_RISCV_SBI_EXT_TIME,
|
||||
KVM_RISCV_SBI_EXT_IPI,
|
||||
KVM_RISCV_SBI_EXT_RFENCE,
|
||||
KVM_RISCV_SBI_EXT_SRST,
|
||||
KVM_RISCV_SBI_EXT_HSM,
|
||||
KVM_RISCV_SBI_EXT_PMU,
|
||||
KVM_RISCV_SBI_EXT_EXPERIMENTAL,
|
||||
KVM_RISCV_SBI_EXT_VENDOR,
|
||||
KVM_RISCV_SBI_EXT_MAX,
|
||||
};
|
||||
|
||||
/* Possible states for kvm_riscv_timer */
|
||||
#define KVM_RISCV_TIMER_STATE_OFF 0
|
||||
#define KVM_RISCV_TIMER_STATE_ON 1
|
||||
@@ -118,6 +154,8 @@ enum KVM_RISCV_ISA_EXT_ID {
|
||||
/* If you need to interpret the index values, here is the key: */
|
||||
#define KVM_REG_RISCV_TYPE_MASK 0x00000000FF000000
|
||||
#define KVM_REG_RISCV_TYPE_SHIFT 24
|
||||
#define KVM_REG_RISCV_SUBTYPE_MASK 0x0000000000FF0000
|
||||
#define KVM_REG_RISCV_SUBTYPE_SHIFT 16
|
||||
|
||||
/* Config registers are mapped as type 1 */
|
||||
#define KVM_REG_RISCV_CONFIG (0x01 << KVM_REG_RISCV_TYPE_SHIFT)
|
||||
@@ -131,8 +169,12 @@ enum KVM_RISCV_ISA_EXT_ID {
|
||||
|
||||
/* Control and status registers are mapped as type 3 */
|
||||
#define KVM_REG_RISCV_CSR (0x03 << KVM_REG_RISCV_TYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_CSR_GENERAL (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_CSR_AIA (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_CSR_REG(name) \
|
||||
(offsetof(struct kvm_riscv_csr, name) / sizeof(unsigned long))
|
||||
#define KVM_REG_RISCV_CSR_AIA_REG(name) \
|
||||
(offsetof(struct kvm_riscv_aia_csr, name) / sizeof(unsigned long))
|
||||
|
||||
/* Timer registers are mapped as type 4 */
|
||||
#define KVM_REG_RISCV_TIMER (0x04 << KVM_REG_RISCV_TYPE_SHIFT)
|
||||
@@ -152,6 +194,96 @@ enum KVM_RISCV_ISA_EXT_ID {
|
||||
/* ISA Extension registers are mapped as type 7 */
|
||||
#define KVM_REG_RISCV_ISA_EXT (0x07 << KVM_REG_RISCV_TYPE_SHIFT)
|
||||
|
||||
/* SBI extension registers are mapped as type 8 */
|
||||
#define KVM_REG_RISCV_SBI_EXT (0x08 << KVM_REG_RISCV_TYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_SBI_SINGLE (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_SBI_MULTI_EN (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_SBI_MULTI_DIS (0x2 << KVM_REG_RISCV_SUBTYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_SBI_MULTI_REG(__ext_id) \
|
||||
((__ext_id) / __BITS_PER_LONG)
|
||||
#define KVM_REG_RISCV_SBI_MULTI_MASK(__ext_id) \
|
||||
(1UL << ((__ext_id) % __BITS_PER_LONG))
|
||||
#define KVM_REG_RISCV_SBI_MULTI_REG_LAST \
|
||||
KVM_REG_RISCV_SBI_MULTI_REG(KVM_RISCV_SBI_EXT_MAX - 1)
|
||||
|
||||
/* V extension registers are mapped as type 9 */
|
||||
#define KVM_REG_RISCV_VECTOR (0x09 << KVM_REG_RISCV_TYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_VECTOR_CSR_REG(name) \
|
||||
(offsetof(struct __riscv_v_ext_state, name) / sizeof(unsigned long))
|
||||
#define KVM_REG_RISCV_VECTOR_REG(n) \
|
||||
((n) + sizeof(struct __riscv_v_ext_state) / sizeof(unsigned long))
|
||||
|
||||
/* Device Control API: RISC-V AIA */
|
||||
#define KVM_DEV_RISCV_APLIC_ALIGN 0x1000
|
||||
#define KVM_DEV_RISCV_APLIC_SIZE 0x4000
|
||||
#define KVM_DEV_RISCV_APLIC_MAX_HARTS 0x4000
|
||||
#define KVM_DEV_RISCV_IMSIC_ALIGN 0x1000
|
||||
#define KVM_DEV_RISCV_IMSIC_SIZE 0x1000
|
||||
|
||||
#define KVM_DEV_RISCV_AIA_GRP_CONFIG 0
|
||||
#define KVM_DEV_RISCV_AIA_CONFIG_MODE 0
|
||||
#define KVM_DEV_RISCV_AIA_CONFIG_IDS 1
|
||||
#define KVM_DEV_RISCV_AIA_CONFIG_SRCS 2
|
||||
#define KVM_DEV_RISCV_AIA_CONFIG_GROUP_BITS 3
|
||||
#define KVM_DEV_RISCV_AIA_CONFIG_GROUP_SHIFT 4
|
||||
#define KVM_DEV_RISCV_AIA_CONFIG_HART_BITS 5
|
||||
#define KVM_DEV_RISCV_AIA_CONFIG_GUEST_BITS 6
|
||||
|
||||
/*
|
||||
* Modes of RISC-V AIA device:
|
||||
* 1) EMUL (aka Emulation): Trap-n-emulate IMSIC
|
||||
* 2) HWACCEL (aka HW Acceleration): Virtualize IMSIC using IMSIC guest files
|
||||
* 3) AUTO (aka Automatic): Virtualize IMSIC using IMSIC guest files whenever
|
||||
* available otherwise fallback to trap-n-emulation
|
||||
*/
|
||||
#define KVM_DEV_RISCV_AIA_MODE_EMUL 0
|
||||
#define KVM_DEV_RISCV_AIA_MODE_HWACCEL 1
|
||||
#define KVM_DEV_RISCV_AIA_MODE_AUTO 2
|
||||
|
||||
#define KVM_DEV_RISCV_AIA_IDS_MIN 63
|
||||
#define KVM_DEV_RISCV_AIA_IDS_MAX 2048
|
||||
#define KVM_DEV_RISCV_AIA_SRCS_MAX 1024
|
||||
#define KVM_DEV_RISCV_AIA_GROUP_BITS_MAX 8
|
||||
#define KVM_DEV_RISCV_AIA_GROUP_SHIFT_MIN 24
|
||||
#define KVM_DEV_RISCV_AIA_GROUP_SHIFT_MAX 56
|
||||
#define KVM_DEV_RISCV_AIA_HART_BITS_MAX 16
|
||||
#define KVM_DEV_RISCV_AIA_GUEST_BITS_MAX 8
|
||||
|
||||
#define KVM_DEV_RISCV_AIA_GRP_ADDR 1
|
||||
#define KVM_DEV_RISCV_AIA_ADDR_APLIC 0
|
||||
#define KVM_DEV_RISCV_AIA_ADDR_IMSIC(__vcpu) (1 + (__vcpu))
|
||||
#define KVM_DEV_RISCV_AIA_ADDR_MAX \
|
||||
(1 + KVM_DEV_RISCV_APLIC_MAX_HARTS)
|
||||
|
||||
#define KVM_DEV_RISCV_AIA_GRP_CTRL 2
|
||||
#define KVM_DEV_RISCV_AIA_CTRL_INIT 0
|
||||
|
||||
/*
|
||||
* The device attribute type contains the memory mapped offset of the
|
||||
* APLIC register (range 0x0000-0x3FFF) and it must be 4-byte aligned.
|
||||
*/
|
||||
#define KVM_DEV_RISCV_AIA_GRP_APLIC 3
|
||||
|
||||
/*
|
||||
* The lower 12-bits of the device attribute type contains the iselect
|
||||
* value of the IMSIC register (range 0x70-0xFF) whereas the higher order
|
||||
* bits contains the VCPU id.
|
||||
*/
|
||||
#define KVM_DEV_RISCV_AIA_GRP_IMSIC 4
|
||||
#define KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS 12
|
||||
#define KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK \
|
||||
((1U << KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS) - 1)
|
||||
#define KVM_DEV_RISCV_AIA_IMSIC_MKATTR(__vcpu, __isel) \
|
||||
(((__vcpu) << KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS) | \
|
||||
((__isel) & KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK))
|
||||
#define KVM_DEV_RISCV_AIA_IMSIC_GET_ISEL(__attr) \
|
||||
((__attr) & KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK)
|
||||
#define KVM_DEV_RISCV_AIA_IMSIC_GET_VCPU(__attr) \
|
||||
((__attr) >> KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS)
|
||||
|
||||
/* One single KVM irqchip, ie. the AIA */
|
||||
#define KVM_NR_IRQCHIPS 1
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_KVM_RISCV_H */
|
||||
|
||||
@@ -43,3 +43,12 @@
|
||||
#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15)
|
||||
#endif
|
||||
__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache)
|
||||
|
||||
/*
|
||||
* Allows userspace to query the kernel for CPU architecture and
|
||||
* microarchitecture details across a given set of CPUs.
|
||||
*/
|
||||
#ifndef __NR_riscv_hwprobe
|
||||
#define __NR_riscv_hwprobe (__NR_arch_specific_syscall + 14)
|
||||
#endif
|
||||
__SYSCALL(__NR_riscv_hwprobe, sys_riscv_hwprobe)
|
||||
|
||||
@@ -419,8 +419,10 @@
|
||||
#define __NR_landlock_create_ruleset 444
|
||||
#define __NR_landlock_add_rule 445
|
||||
#define __NR_landlock_restrict_self 446
|
||||
#define __NR_memfd_secret 447
|
||||
#define __NR_process_mrelease 448
|
||||
#define __NR_futex_waitv 449
|
||||
#define __NR_set_mempolicy_home_node 450
|
||||
#define __NR_cachestat 451
|
||||
|
||||
#endif /* _ASM_S390_UNISTD_32_H */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user