2019-05-29 14:18:02 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-09-09 10:40:47 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2015 Intel Corporation.
|
|
|
|
*
|
|
|
|
* Authors: David Woodhouse <David.Woodhouse@intel.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __INTEL_SVM_H__
|
|
|
|
#define __INTEL_SVM_H__
|
|
|
|
|
2021-08-18 13:48:49 +00:00
|
|
|
/* Page Request Queue depth */
|
|
|
|
#define PRQ_ORDER 2
|
|
|
|
#define PRQ_RING_MASK ((0x1000 << PRQ_ORDER) - 0x20)
|
|
|
|
#define PRQ_DEPTH ((0x1000 << PRQ_ORDER) >> 5)
|
|
|
|
|
2015-10-15 14:52:15 +00:00
|
|
|
/*
|
|
|
|
* The SVM_FLAG_SUPERVISOR_MODE flag requests a PASID which can be used only
|
|
|
|
* for access to kernel addresses. No IOTLB flushes are automatically done
|
|
|
|
* for kernel mappings; it is valid only for access to the kernel's static
|
|
|
|
* 1:1 mapping of physical memory — not to vmalloc or even module mappings.
|
|
|
|
* A future API addition may permit the use of such ranges, by means of an
|
|
|
|
* explicit IOTLB flush call (akin to the DMA API's unmap method).
|
|
|
|
*
|
|
|
|
* It is unlikely that we will ever hook into flush_tlb_kernel_range() to
|
|
|
|
* do such IOTLB flushes automatically.
|
|
|
|
*/
|
2021-03-23 01:05:58 +00:00
|
|
|
#define SVM_FLAG_SUPERVISOR_MODE BIT(0)
|
2020-05-16 06:20:47 +00:00
|
|
|
/*
|
|
|
|
* The SVM_FLAG_GUEST_MODE flag is used when a PASID bind is for guest
|
|
|
|
* processes. Compared to the host bind, the primary differences are:
|
|
|
|
* 1. mm life cycle management
|
|
|
|
* 2. fault reporting
|
|
|
|
*/
|
2021-03-23 01:05:58 +00:00
|
|
|
#define SVM_FLAG_GUEST_MODE BIT(1)
|
2020-05-16 06:20:47 +00:00
|
|
|
/*
|
|
|
|
* The SVM_FLAG_GUEST_PASID flag is used when a guest has its own PASID space,
|
|
|
|
* which requires guest and host PASID translation at both directions.
|
|
|
|
*/
|
2021-03-23 01:05:58 +00:00
|
|
|
#define SVM_FLAG_GUEST_PASID BIT(2)
|
2015-10-15 12:59:14 +00:00
|
|
|
|
2015-09-09 10:40:47 +00:00
|
|
|
#endif /* __INTEL_SVM_H__ */
|