Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright © 2015 Intel Corporation.
4 *
5 * Authors: David Woodhouse <David.Woodhouse@intel.com>
6 */
7
8#ifndef __INTEL_SVM_H__
9#define __INTEL_SVM_H__
10
11/* Values for rxwp in fault_cb callback */
12#define SVM_REQ_READ (1<<3)
13#define SVM_REQ_WRITE (1<<2)
14#define SVM_REQ_EXEC (1<<1)
15#define SVM_REQ_PRIV (1<<0)
16
17/* Page Request Queue depth */
18#define PRQ_ORDER 2
19#define PRQ_RING_MASK ((0x1000 << PRQ_ORDER) - 0x20)
20#define PRQ_DEPTH ((0x1000 << PRQ_ORDER) >> 5)
21
22/*
23 * The SVM_FLAG_SUPERVISOR_MODE flag requests a PASID which can be used only
24 * for access to kernel addresses. No IOTLB flushes are automatically done
25 * for kernel mappings; it is valid only for access to the kernel's static
26 * 1:1 mapping of physical memory — not to vmalloc or even module mappings.
27 * A future API addition may permit the use of such ranges, by means of an
28 * explicit IOTLB flush call (akin to the DMA API's unmap method).
29 *
30 * It is unlikely that we will ever hook into flush_tlb_kernel_range() to
31 * do such IOTLB flushes automatically.
32 */
33#define SVM_FLAG_SUPERVISOR_MODE BIT(0)
34/*
35 * The SVM_FLAG_GUEST_MODE flag is used when a PASID bind is for guest
36 * processes. Compared to the host bind, the primary differences are:
37 * 1. mm life cycle management
38 * 2. fault reporting
39 */
40#define SVM_FLAG_GUEST_MODE BIT(1)
41/*
42 * The SVM_FLAG_GUEST_PASID flag is used when a guest has its own PASID space,
43 * which requires guest and host PASID translation at both directions.
44 */
45#define SVM_FLAG_GUEST_PASID BIT(2)
46
47#endif /* __INTEL_SVM_H__ */