at v5.17 1.4 kB view raw
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/* Page Request Queue depth */ 12#define PRQ_ORDER 2 13#define PRQ_RING_MASK ((0x1000 << PRQ_ORDER) - 0x20) 14#define PRQ_DEPTH ((0x1000 << PRQ_ORDER) >> 5) 15 16/* 17 * The SVM_FLAG_SUPERVISOR_MODE flag requests a PASID which can be used only 18 * for access to kernel addresses. No IOTLB flushes are automatically done 19 * for kernel mappings; it is valid only for access to the kernel's static 20 * 1:1 mapping of physical memory — not to vmalloc or even module mappings. 21 * A future API addition may permit the use of such ranges, by means of an 22 * explicit IOTLB flush call (akin to the DMA API's unmap method). 23 * 24 * It is unlikely that we will ever hook into flush_tlb_kernel_range() to 25 * do such IOTLB flushes automatically. 26 */ 27#define SVM_FLAG_SUPERVISOR_MODE BIT(0) 28/* 29 * The SVM_FLAG_GUEST_MODE flag is used when a PASID bind is for guest 30 * processes. Compared to the host bind, the primary differences are: 31 * 1. mm life cycle management 32 * 2. fault reporting 33 */ 34#define SVM_FLAG_GUEST_MODE BIT(1) 35/* 36 * The SVM_FLAG_GUEST_PASID flag is used when a guest has its own PASID space, 37 * which requires guest and host PASID translation at both directions. 38 */ 39#define SVM_FLAG_GUEST_PASID BIT(2) 40 41#endif /* __INTEL_SVM_H__ */