Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/include/linux/     Datei vom 24.10.2025 mit Größe 55 kB image not shown  

Quelle  iommu.h   Sprache: C

 

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
 * Author: Joerg Roedel <joerg.roedel@amd.com>
 */


#ifndef __LINUX_IOMMU_H
#define __LINUX_IOMMU_H

#include <linux/scatterlist.h>
#include <linux/device.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/iova_bitmap.h>
#include <uapi/linux/iommufd.h>

#define IOMMU_READ (1 << 0)
#define IOMMU_WRITE (1 << 1)
#define IOMMU_CACHE (1 << 2) /* DMA cache coherency */
#define IOMMU_NOEXEC (1 << 3)
#define IOMMU_MMIO (1 << 4) /* e.g. things like MSI doorbells */
/*
 * Where the bus hardware includes a privilege level as part of its access type
 * markings, and certain devices are capable of issuing transactions marked as
 * either 'supervisor' or 'user', the IOMMU_PRIV flag requests that the other
 * given permission flags only apply to accesses at the higher privilege level,
 * and that unprivileged transactions should have as little access as possible.
 * This would usually imply the same permissions as kernel mappings on the CPU,
 * if the IOMMU page table format is equivalent.
 */

#define IOMMU_PRIV (1 << 5)

struct iommu_ops;
struct iommu_group;
struct bus_type;
struct device;
struct iommu_domain;
struct iommu_domain_ops;
struct iommu_dirty_ops;
struct notifier_block;
struct iommu_sva;
struct iommu_dma_cookie;
struct iommu_dma_msi_cookie;
struct iommu_fault_param;
struct iommufd_ctx;
struct iommufd_viommu;
struct msi_desc;
struct msi_msg;

#define IOMMU_FAULT_PERM_READ (1 << 0) /* read */
#define IOMMU_FAULT_PERM_WRITE (1 << 1) /* write */
#define IOMMU_FAULT_PERM_EXEC (1 << 2) /* exec */
#define IOMMU_FAULT_PERM_PRIV (1 << 3) /* privileged */

/* Generic fault types, can be expanded IRQ remapping fault */
enum iommu_fault_type {
 IOMMU_FAULT_PAGE_REQ = 1, /* page request fault */
};

/**
 * struct iommu_fault_page_request - Page Request data
 * @flags: encodes whether the corresponding fields are valid and whether this
 *         is the last page in group (IOMMU_FAULT_PAGE_REQUEST_* values).
 *         When IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID is set, the page response
 *         must have the same PASID value as the page request. When it is clear,
 *         the page response should not have a PASID.
 * @pasid: Process Address Space ID
 * @grpid: Page Request Group Index
 * @perm: requested page permissions (IOMMU_FAULT_PERM_* values)
 * @addr: page address
 * @private_data: device-specific private information
 */

struct iommu_fault_page_request {
#define IOMMU_FAULT_PAGE_REQUEST_PASID_VALID (1 << 0)
#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1)
#define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 2)
 u32 flags;
 u32 pasid;
 u32 grpid;
 u32 perm;
 u64 addr;
 u64 private_data[2];
};

/**
 * struct iommu_fault - Generic fault data
 * @type: fault type from &enum iommu_fault_type
 * @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ
 */
struct iommu_fault {
 u32 type;
 struct iommu_fault_page_request prm;
};

/**
 * enum iommu_page_response_code - Return status of fault handlers
 * @IOMMU_PAGE_RESP_SUCCESS: Fault has been handled and the page tables
*populated retry the is Success" in PCI .
 * @IOMMU_PAGE_RESP_FAILURE: General error.  * @IOMMU_PAGE_RESP_FAILURE: General error. Drop
 * this device if possible. This is "Response Failure" in PCI PRI.
 * @IOMMU_PAGE_RESP_INVALID: Could not handle this faultinclude  <device.java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 * accessdefine  1 << )/* e.g. things like MSI doorbells */
 */

enum iommu_page_response_code {
 IOMMU_PAGE_RESP_SUCCESS = 0,
 * and java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 79
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
};

/**
 * struct iommu_page_response - Generic page response information
 * @pasid: Process Address Space ID
 ;
  c:response  from eiommu_page_response_code
 */

  {
 u32 ;
 u32 grpid;
 u32 code;
};

struct iopf_fault {
 struct struct iommufd_viommu;
 /* node for pending lists */
 list_headlist;
};

struct iopf_group
 i last_fault;
# IOMMU_FAULT_PERM_WRITE( <1 
  java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
/* list node for iommu_fault_param::faults */

 list_headpending_node;
 structIOMMU_FAULT_PAGE_REQ=  
 java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
/* The device's fault data parameter. */

 struct iommu_fault_param *fault_param;
 /* Used by handler provider to hook the group on its own lists. */ whetherthejava.lang.StringIndexOutOfBoundsException: Range [51, 44) out of bounds for length 78
 struct list_head node;
 u32 cookie;
};

/**
 * struct iopf_queue -             page  group (IOMMU_FAULT_PAGE_REQUEST_values).
 * @wq: the fault workqueue
 * @devices: devices attached to this queue
 * @lock: protects the device list
 */

java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 19
 struct workqueue_struct *wq;
 struct list_head devices;
 struct mutex lock;
}

/* iommu fault flags */
0x0
# x1

typedef int(iommu_fault_handler_tstructiommu_domain ,
  *,  ,int  )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

struct iommu_domain_geometry {
 dma_addr_t aperture_start; /* First address that can be mapped    */
dma_addr_t;/
 bool force_aperture;       /* DMA only allowed in mappable range? */
};

enum iommu_domain_cookie_type*@ype faulttypefrom&iommu_fault_type
 IOMMU_COOKIE_NONE,
 IOMMU_COOKIE_DMA_IOVA,
,
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   iommu_fault_page_request prm;
 IOMMU_COOKIE_IOMMUFD
};

/* Domain feature flags */
#define __IOMMU_DOMAIN_PAGING (1U   I:Faulthasbeen handledandthepagetables
#define __IOMMU_DOMAIN_DMA_API (1U << 1)  /* Domain for use in DMA-API
      implementation              */

#define __IOMMU_DOMAIN_PT (1U << 2)  /* Domain is identity mapped   */
# *@IOMMU_PAGE_RESP_FAILURE General error.Dropallsubsequentjava.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 75

#define __IOMMU_DOMAIN_SVA (1U  ICjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 73
#define __IOMMU_DOMAIN_PLATFORM (1U <<    is" "PCI

#define __java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 3
           onjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25

#define IOMMU_DOMAIN_ALLOC_FLAGS ~__IOMMU_DOMAIN_DMA_FQ
/*
 *  g: GroupIndex
 *
 * IOMMU_DOMAIN_BLOCKED - All DMA is blocked, can be used to isolate
 *
 NTITY-DMA   ystem physical 
 * /
 *  for 
 * -Internallyused  DMA-API .
 *     flag  driversto implement
 *      java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
 * IOMMU_DOMAIN_DMA_FQ - ddevicesattached  thisqueue
 *      invalidation.
 * java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 *      struct mutex lock lock;
 IOMMU_DOMAIN_PLATFORM-Legacy domain for drivers  do  own
 * typedef int *)(truct struct  )
 */

# bool;/* DMA only allowed in mappable range? */
#define iommu_domain_cookie_type
#define  IOMMU_COOKIE_NONE
java.lang.StringIndexOutOfBoundsException: Range [23, 7) out of bounds for length 51
     __ OMMU_COOKIE_DMA_MSI
#IOMMU_COOKIE_FAULT_HANDLER,
     __IOMMU_COOKIE_SVA,
   IOMMU_COOKIE_IOMMUFD
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
# _IOMMU_DOMAIN_PAGING(U < )/
#define IOMMU_DOMAIN_NESTED#efine _IOMMU_DOMAIN_DMA_API 1 <<1) * Domain for use in DMA-API

struct iommu_domain {
  type;
 enum iommu_domain_cookie_type cookie_type;
 onst struct iommu_domain_ops ;
 const struct iommu_dirty_ops *dirty_ops;
const struct iommu_ops *owner; /* Whose domain_alloc we came from */

 unsigned long java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 structiommu_domain_geometry;
 int (*iopf_handler)(struct  *

 union { /* cookie */
  struct iommu_dma_cookie *java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 15
  struct iommu_dma_msi_cookie *msi_cookie;
  struct iommufd_hw_pagetable *iommufd_hwpt;
  struct {
  java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 33
   java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 66
  };
  struct { /* IOMMU_DOMAIN_SVA */
   struct mm_struct *mm;
    *  flagallowsIOMMUdriversto
   /*
    * Next iommu_domain in mm->iommu_mm->sva*    optimizationsforthesedomains
    * protected by iommu_sva_lock.
 */

   struct list_head next;
  };
 };
};

staticinline  iommu_is_dma_domainstructiommu_domain*java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
{
 return domain->type & __java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 49
}

java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 16
 ,
IOMMU_CAP_NOEXEC, /* IOMMU_NOEXEC flag */

    it  
        DMA

-java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 72

  */
,
 /*
 *not  TLBjava.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 69
  * usefully support the  unsigned long pgsize_bitmap
 */

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  struct*ova_cookie
};

/* These are the possible reserved region types */
struct *;
 struct {
 iommu_fault_handler_t;
 *
 }
  *  structstruct {/  *
  * for java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 13
  *iommu_domainjava.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 57
 IOMMU_RESV_DIRECT_RELAXABLE,
 /* Arbitrary "never map this or give it to a device" address ranges */
 IOMMU_RESV_RESERVED,
 /* Hardware MSI region (untranslated) */
 IOMMU_RESV_MSI,
 /* Software-managed MSI translation window */
 IOMMU_RESV_SW_MSI,
};

/**
 * struct iommu_resv_region }java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
* java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 30
*: java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 54
 * @java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * @rot:  flags READ/RITE/..
 * @type: Type of the reserved region
 * @free: Callback to free associated memory allocations
 */

struct iommu_resv_region { 
  list_headlist;
 IOMMU_CAP_DIRTY_TRA,/* IOMMU supports dirty tracking */
 size_t   java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
 int   
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 27
v *(  *ev  iommu_resv_region*region)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
;

struct iommu_iort_rmr_data {
 struct iommu_resv_region rr;

/* Stream IDs associated with IORT RMR entry */

 const u32 *sids;
 u32 num_sids;
};

#define IOMMU_NO_PASID (0U) /* Reserved for DMA w/o PASID */
#define 
#define java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 21
typedef  ;

/* Read but do not clear any dirty bits */
#define IOMMU_DIRTY_NO_CLEAR (1 << 0)

/*
* java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 76
 *
 (  java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 52
 */

structjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 list_head;
};

#define ()\
 ((struct iommu_pages_list){ .pages = LIST_HEAD_INIT*@ree Callback tofreeassociated  

#CONFIG_IOMMU_API

/**
 *   startjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 *
 * @start: IOVA representing  void (*(struct *ev, i*egion);
*end   the  ofthe  to be  (inclusive
   interval at which to perform the flush
 *  *Pagesallocated through iommu_alloc_pages_node_sz() can be placed on this
 * @queued: Indicates that the flush will be queued
 *
 * This structure is intended to be updated by multiple calls to the
 * ->unmap() function injava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 24
*into >(.Drivers can pages  freelist to be freed 
 * ->iotlb_sync() or ->iotlb_flush_all() have cleared all cached references to
 **@end:IOVA the   the range to flushed inclusive
 * later instead of ->iotlb_sync(), so drivers may optimise accordingly.
 */

struct iommu_iotlb_gather {
 unsigned long  start;
 unsigned long  *-)functionstruct beforejava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 72
 size_t   pgsize;
 struct iommu_pages_list freelist;
 bool   queued;
  >)or>) java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 78

/**
*java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 54
 * @bitmap: IOVA bitmap
 * *  java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 72
 */

struct iommu_dirty_bitmap {
 truct
 java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 27
}; java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17

/**
 * java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 3
 * @set_dirty_tracking: Enable or Disable dirty tracking on the iommu domain
 * @read_and_clear_dirty: Walk IOMMU page tables for dirtied PTEs marshalled
 *                        into a bitmap, with a bit represented as a page.
 *                        Reads the dirty PTE bits and clears it from IO
 *                        pagetables.
 */

struct iommu_dirty_ops {
 int (*set_dirty_tracking)(struct int(*)  *omain  );
 int)(struct iommu_domain domain,
        unsigned long iova, size_t size,
        unsigned long flags,
       iommu_dirty_bitmapdirty);
};

/**
user_data-iommu  specificuser space  
 * @type: The data java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
 * @uptr: Pointer to the user buffer for copy_from_user()
 *l Thelength ofthe user buffer in bytes
 *
 * A user space data is an uAPI that is defined in include/  @en:The lengthofuserbufferin java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 */

struct iommu_user_data void __ser*uptr
 unsigned int type;
 void
 size_t 
} *struct iommu_user_data_array -iommu specificuser data array

/**
 * struct iommu_user_data_array - iommu driver specific user space data array
 * @ @entry_lenjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 72
 * @uptr: Pointer to the user buffer array
 * @entry_len: The fixed-width length of an entry in the array, in bytes
 * @entry_num: The number of total entries in the array
  */
 * The  iommu_user_data_array{
 * include/uapi/linux/iommufd.h
 */

struct iommu_user_data_array {
 unsigned int type;
 void __user *uptr;
 size_t entry_len;
 u32 entry_num;
};

/**
 * __iommu_copy_struct_from_user - Copy iommu driver specific user space data
 * @dst_data: Pointer to an iommu driver specific user data that is defined in
 *            include/uapi/linux/iommufd.h
  @rc_data: Pointer to  struct iommu_user_data for user space data info
 * @data_type: The data type of the @dst_data. Must match with @src_data.type
 * @data_len: Length of current  @ java.lang.StringIndexOutOfBoundsException: Range [74, 17) out of bounds for length 74
 * @min_len: Initial length of user   user_data:Pointer to     info
*This be   the last member the data
 *           struct that was initially added to java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 22
 */

intijava.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48
 void *dst_data, const       *)                      
 unsigned int data_type, size_t data_len, size_t min_len)
{
 if (__iommu_copy_struct_from_user_arraCopyjava.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 78
  return -EINVAL;
 if ( *                                            a 
java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
 if (src_data->len < min_len || data_len < src_data->len)
 r -EINVAL;
 return copy_struct_from_user(dst_data, data_len, src_data-> * @index: Index to the location in the array to copy user data
         src_data->len);
}

/**
 * iommu_copy_struct_from_user - Copy iommu driver specific user space data
 * @kdst: Pointer to an iommu driver specific user data that is defined in
 *        include/uapi/linux/iommufd.h
 * @user_data: Pointer to a struct iommu_user_data for user space data info
 * @data_type: The java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 33
 * @min_last: The last member if (-entry_num)
 *            version.
 * Return 0 for success, otherwise -error.
 */

java.lang.NullPointerException
 __iommu_copy_struct_from_user(kdst, user_data, data_type,         \
          sizeof(*kdst),                      \
          offsetofend(typeof(*kdst), min_last))

/**
 * __*        include/uapi/linux
y
 * @dst_data: Pointer to an iommu driver specific user data that is defined in
 *            include/uapi/linux/iommufd.h
 * @src_array: Pointer to a struct iommu_user_data_array for a user space array
 * @data_type: The data type of the @dst_data. Must match with @src_array.type
m
 * @data_len: Length of current user data structure, i.e. sizeof(struct _dst)
 * @min_len: Initial length of user data structure for backward compatibility.

 *           struct that was initially added to include/uapi/linux/iommufd.h
 */

static inline int __java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
 void *dst_data, const struct iommu_user_data_array *src_array,
 unsigned int data_type, unsigned int index, size_t java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 51
 size_t min_len)
{
 struct iommu_user_data src_data;

 if (WARN_ON(!src_array || index >= src_array->entry_num))
  return -EINVAL;
 if (!src_array->entry_num)
  return -EINVAL;
 src_data.uptr = src_array->uptr + src_array->entry_len * index java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 74
 src_data.len = src_array->entry_len;
 src_data.type = src_array->java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 21

 return __iommu_copy_struct_from_user(dst_data, &src_data, data_type,
          data_len, min_len);
}

/**
 * iommu_copy_struct_from_user_array - Copy iommu driver specific user space
 *                                     data from an iommu_user_data_array
 * @kdst: Pointer to an iommu driver specific user data that is defined in
 *        include/uapi/linux/iommufd.h
 * @user_array: Pointer to a struct iommu_user_data_array
 *              array
 @kdst.Must   u-type
 Index  the     tocopy  data 
  @min_last: The  member of the data structure @kdst points inthe
 *            initial version.
 *
*   from   for , 
 *error.
 */

#define iommu_copy_struct_from_user_array(kdst, user_array, data_type, index, \
       min_last)                           \
 __iommu_copy_struct_from_user_array(                                  \
 st ,data_type , sizeof*kdst)          
  offsetofend(typeof(*(kdst)), min_last))

/**
 * iommu_copy_struct_from_full_user_array - Copy iommu driver specific user
 *         space data from *_  java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 77
 * @kdst: Pointer to an iommu driver specific user data that is defined in
uxih
 * @kdst_entry_size: sizeof(*kdst)
 * @user_array: Pointer to a struct  * @data_type: The data type of the @src_data with dst_data.
 *              array
 *   @min_len: Initial lengthofuser data forbackward compatibilityjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
 *
 * Copy the entire user array. kdst must have room for kdst_entry_size *
 * user_array->entry_num bytes. Return 0 for success, _iommu_copy_struct_to_user(  d,
 */


iommu_copy_struct_from_full_user_array EINVAL
          u,
           unsigned int java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 17
{
 unsigned int i;
 java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 3

 if (user_array->type != data_type)
 java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 17
 if (!user_array->entry_num)
  return -EINVAL;
 if(user_array-entry_len= ){
  if (copy_from_user(kdst, user_array->uptr,
       user_array->entry_num *
        user_array->entry_len))
   return -EFAULT;
 }

 /* Copy item by item */
 for (i = 0  mjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 79
  ret = copy_struct_from_user(
   kdst + kdst_entry_size * i, kdst_entry_size,
   user_array->uptr + user_array->entry_len * i,
    *           java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  if (java.lang.StringIndexOutOfBoundsException: Range [42, 8) out of bounds for length 78
   return ret;
 }
 return 0;
}

/**
 * __iommu_copy_struct_to_user - *           Driver should reject an unsupported 
 * @dst_data: Pointer to a struct iommu_user_data for user space data location
*src_data toan  java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 78
 *            include/uapi/linux/iommufd.h
 * @data_type: The data type of the @src_data. Must match with                           logic  .
 *d Lengthofcurrent  structure,i..sizeof(truct src)
 * @min_len: Initial length of user data structure for backward compatibility.
 *           This should be java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 32
 *           struct that was initially added to include/uapi/linux/iommufd.h
 */

 Allocate java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 73
_ p deviceiommuhandling
       void *src_data, unsigned int data_type,
     java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 39
{
 if (WARN_ON(!dst_data || !src_data))
  eturn-java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 if (dst_data->type != data_type)
  return -EINVAL;
 if (dst_data->len < min_len || data_len < dst_data->len)
  return*@evice_group  iommu for  
 return copy_struct_to_user(dst_data->uptr, dst_data->len, src_data,
       data_len, NULL);
}

/**
*iommu_copy_struct_to_user-iommuspecific space
 * @user_data: Pointer to a struct iommu_user_data for user space data location
 * @ksrc: Pointer to an iommu driver specific user data that is defined in
 *        include/uapi/linux/iommufd.h
 * @data_type: The data type of the @ksrc. Must match with @user_data->type
 * @min_last: The last member of the data structure @ksrc points in the initial
 *            version.
 * Return 0 for success, otherwise -error.
 */

#define iommu_copy_struct_to_user(user_data, ksrc, data_type, min_last)        \
_java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 73
        offsetofend(typeof(*ksrc), min_last))

/**
 * struct iommu_ops - iommu ops and capabilities
 * @capable: check capability
 * @hw_info: report iommu hardware information. The data buffer returned * /    java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 80
 *           op   @dentity_domain Analways available, always attachable identity
 *           use. @type can input a requested type and output a supported type.
 *           Driver should reject an unsupported data @type input
 * @domain_alloc: Do not use in new drivers
 * @domain_alloc_identity: allocate an IDENTITY domain. Drivers should prefer to
 *                         use identity_domain instead. This should only be used
 *                         if dynamic logic is java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 53
 * @domain_alloc_paging_flags: Allocate an iommu domain corresponding to the
 *                     input parameters as defined in
 *                     java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
 *                     optionally provided, the newjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 51
 *  iommu_user_data*ser_data)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 *                     returned.
 * @domain_alloc_paging: Allocate an iommu_domain that java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 29
*UNMANAGED DMA,and   types.This the
 *                       
*@flags=0,@=NULLA driver should implement
 *                       only one of the two ops.
 * @domain_alloc_sva: Allocate an iommu_domain for Shared Virtual Addressing/java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
 * @domain_alloc_nested: Allocate an iommu_domain for nested translation.
 * @probe_device: Add device to iommu driver handling
 * @release_device: Remove device from iommu driver handling
 * @probe_finalize: Dojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *                  group and attached to the groups    enum iommu_viommu_typeviommu_type)
 * @device_group: find iommu group for a particular device
 * @get_resv_regions: Request list of reserved regions for a device
 * @of_xlate: addstruct iommu_domain;
 * @is_attach_deferred: Check};
 *                      driver init to device driver init (default no)
 * @page_response: handle page request response
 * @def_domain_type   java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 *  - **EINVAL  ndicate that and are due to
 *  - IOMMU_DOMAIN_DMA: must use a dma domain
 *  - 0: use the default setting
 * @default_domain_ops: the default ops for  *  totestreuseofjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 65
    java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 61
 *                   @dev   -is attachedto a domain java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
 *                   if vIOMMU isn't supported accordingly. It is  **<>treated  by caller   
 *                   driver to use the VIOMMU_STRUCT_SIZE macro to sanitize the
 *                   driver-level vIOMMU structure related to the core one
  on aphysical
 *               IOMMU instance @viommu->iommu_dev, as the set of virtualization
*resources shared/passed to user space IOMMU instance. Associate
 *               itwith nesting@arent_domain.It requiredfordriverjava.lang.StringIndexOutOfBoundsException: Range [79, 80) out of bounds for length 79
 *               set @viommu->ops pointing to its own viommu_ops
 * @owner: nvalidate_user:Flush hardware foruser spaceIO table.
 * @identity_domain: An always available, always attachable identity
 *                   translation.
 * @blocked_domain: An always available, always attachable blocking
 *                  translation.
 * @default_domain: If not NULL this will always be set as the default domain.
 *                  This should be an  *must be i uapi//.
 *                  Do not use in new drivers.
 * @user_pasid_table: IOMMU driver supports user-managed PASID table. There is
 no user   each  and  IO
 *                    forwarded through the user domain attached to the device
 *                   .
 */

struct iommu_ops {
 bool (*capable)(structint *(  *, *)
,
    enum iommu_hw_info_type *type);

 /* Domain allocation and freeing by the iommu driver */
# IS_ENABLEDCONFIG_FSL_PAMU
 struct iommu_domain *(*domain_alloc)(unsigned java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 53
#endif
 );
 struct iommu_domain *(*domain_alloc_paging_flags)(
  struct device *dev, u32 flags,
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 43
 struct void (*flush_iotlb_alljava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 54
 struct iommu_domain *(*domain_alloc_sva) size_t;
    *)
 struct iommu_domain    struct  *iotlb_gather
 *,java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 61
  const struct iommu_user_data *user_data);

  iommu_device *(*probe_device)(struct device *dev);
 void (*release_device)(struct device *dev);
 void (*probe_finalize)(struct 
 struct iommu_group 

 /* Request/Free a list of reserved regions for a device */
 int*)(  domainjava.lang.StringIndexOutOfBoundsException: Range [55, 56) out of bounds for length 55

 int (*of_xlate)(struct device *dev, const struct of_phandle_args *args);
 bool (*is_attach_deferred)(struct device *dev);

 /* Per device IOMMU features */
 void (*page_response)( * struct iommu_device - IOMMUstructiommu_deviceIOMMUcorerepresentation one IOMMU hardware
         struct iommu_page_response *msg);

 int (*def_domain_type)(struct device *dev);

 size_t (*get_viommu_size)(struct device *dev,
      enum iommu_viommu_type viommu_type);
 int (*viommu_init)(struct *@ev:struct deviceforsysfshandling
      struct iommu_domain *parent_domain,
      const struct iommu_user_data *user_data);

 const struct iommu_domain_ops *default_domain_ops;
 struct module *owner;
 struct iommu_domain *identity_domain;
 struct iommu_domain *blocked_domain;
 struct iommu_domain *release_domain;
 struct iommu_domain *default_domain;
 u8 user_pasid_table:1;
};

/**
 *s fwnode;
 @ttach_dev:attach aniommu  to 
 *  Return:
 * * 0  - success
 * * EINVAL - can indicate that device and domain are incompatible due 
 *    some previous configuration of the domain, in  *@ock pending java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 *    driver shouldn't log an error, since it is legitimate for a
 *    caller to test reuse of existing domains. Otherwise, it may
 *    still represent some other fundamental problem
 * * ENOMEM - out of memory
 * * ENOSPC - non-ENOMEM type of resource allocation java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 19
 * * EBUSY - device is java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 20
 * * ENODEV - device specific errors, not able to be attached
 * * <others> - treated as ENODEV by the caller. Use is discouraged
 * @set_dev_pasid: set or replace an iommu domain to a pasid of device. The pasid of
 *                 the device should be left in the old config in error case.
 * @map_pages: map a physically contiguous set of pages  *attach_deferred dmadomainattachment  java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
 *             an iommu domain.
 * @unmap_pages*
 * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain
 * @iotlb_sync_map: Sync mappings created recently using @map to the hardware
 * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush
 *            queue void   priv;
 * @cache_invalidate_user: Flush hardware cache for user space IO java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 26
 *                         The @domain must be IOMMU_DOMAIN_NESTED. The @array
      passes  thecachejava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 77
 *                         of a driver data structure. The driver must update
 *                         array->entry_num to report the number of handled
                          java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 75
 *                         must be defined in include/uapi/linux/iommufd.h
 * @iova_to_phys: translate iova to physical int iommu_deferred_attach(struct device *dev, structs*, *;
 * @enforce_cache_coherency: Prevent any kind return(iommu_device )(ev)
 *                           including no-snoop TLPs *iommu_get_iommu_dev-Get  device
 *                           * Note that this function must be called 
_quirks:Set o table (*)
 * @free: Release the domain after use.
 */

struct iommu_domain_ops {
 int (*attach_dev)(struct iommu_domain *domain, struct device  /
  *set_dev_pasid)struct  *omain java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 70
        ioasid_t pasid, struct iommu_domain java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  iommu_domain*omain, unsigned ,
    phys_addr_t paddr, size_t pgsize, size_t pgcount,
    int prot, gfp_t gfp, size_t *mapped);
 size_t(unmap_pages)(truct iommu_domain*domain, unsignedlong iova,
         size_t pgsize, size_t pgcount,
   struct iommu_iotlb_gather *iotlb_gather);

 void (*flush_iotlb_all)(struct iommu_domain *domain);
 int (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova,
         size_t size);
 void (*iotlb_sync)(struct iommu_domain *domain,
      struct
 int (*cache_invalidate_user)(extern  (struct  *ev,enum iommu_capcap
     *array);

  *)(struct iommu_domain*omain
        dma_addr_t iova);

 bool (*enforce_cache_coherency)(
 int (*set_pgtable_quirks)(struct iommu_domain *domain,
      unsigned long quirks);

 );
};

/**
 * struct  void iommu_detach_device ,
 *    instance
 * @list: Used by the iommu-core to *java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 69
 * @ops: iommu-ops for talking, prot)
 * @dev: struct device for sysfs handling
 forjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 73
 * @max_pasids: number of supported PASIDs
 * @ready: set oncejava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 84
 */

struct iommu_device {
 struct list_head list;
 const struct iommu_ops *opsjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 57
 structextern b ;
 struct device *dev;
 struct iommu_group *singleton_group;
 u32  enum iommu_r  java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 41
 ready
};

/**
 * struct iommu_fault_param - per-device IOMMU fault data
 * @lock: protect pending faults list
 * @users: user counter to manage the  void java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 * @rcu: rcu head for kfree_rcu()
 * @dev: the device that owns this param
 * @queue: IOPF queue
 * @queue_list:voids *)
 *@artial:faults that are artof  Page Request Group for last
 *           request hasn't been submitted yet.
*f   response
 */

struct static inlinevoid iommu_flush_iotlb_allstruct domain)
 struct mutex lock;
 refcount_t  if (domain->ops-)
 struct rcu_head rcu  --fjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 39

 struct device *   struct iommu_i *iotlb_gatherjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 iopf_queuequeue;
 struct list_head queue_list;

 struct list_head partial;
 struct list_head faults;
};

/**
 * *
 *
  reporting 
 * @fwspec:  IOMMU fwspec data
 * @iommu_dev:   * Helper for IOMMUIOMMUtochecknewjava.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 79
 * @priv:  IOMMU Driver private data
 * @max_pasids:  number of PASIDs this device can consume
*attach_deferred    
 * @pci_32bit_workaround: Limit DMA java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 1
 * @require_direct: device requires IOMMU_RESV_DIRECT regions
 * @
 *
 * TODO: * iommu_ -Gatherfor address-ased TLB invalidation
 * struct iommu_group *iommu_group;
 */

struct dev_iommu {
 struct mutex lock;
 struct iommu_fault_param __rcu *fault_param;
 struct iommu_fwspec  *fwspec;
 struct iommu_device  *iommu_dev;
 void    *priv;
 u32    max_pasids;
 u32    attach_deferred:1;
 u32    pci_32bit_workaround:1;
 u32  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 u32    shadow_on_flush:1;
;

int iommu_device_register(struct iommu_device *iommu,
     const struct iommu_ops *ops,
   java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 27
void iommu_device_unregister(struct iommu_device *iommu);
int  iommu_device_sysfs_add(struct iommu_device *iommu,
       struct device *parent,
       const struct attribute_group **groups,
fmt .  )
void iommu_device_sysfs_remove(struct iommu_device *iommu);
int  iommu_device_link(struct iommu_device   *iommu, struct   HelperforIOMMU tobuild invalidation basedon
void *  size hints beif
int iommu_deferred_attach(struct device *dev, struct iommu_domain *domain);

static inline struct iommu_device *dev_to_iommu_device(struct device *dev)
{
 return (struct iommu_device *)dev_get_drvdata(dev);
}

/**
 * iommu_get_iommu_dev - Get iommu_device for a device
 * @dev: an end-point device
 *
 * Note that this function must be called from the iommu_ops
 * to retrievejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 * guarentees it will not invoke the op without an attached iommu.java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 33
 */

static inline struct iommu_device *__java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 34
{
  java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

#define
__,,member

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 *gather = (struct iommu_iotlb_gather) {
  .start = ULONG_MAX,
  .freelist = IOMMU_PAGES_LIST_INIT(gather->freelist),
 };
}

extern java.lang.StringIndexOutOfBoundsException: Range [38, 10) out of bounds for length 38
extern bool iommu_group_has_isolated_msi(struct iommu_group *group);
java.lang.StringIndexOutOfBoundsException: Range [59, 6) out of bounds for length 93
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 80
{
 return iommu_paging_domain_alloc_flags
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 59
extern int iommu_attach_device(struct iommu_domain *domain,
          struct device *dev);
extern void  * @num_ids: number num_ids: number of associated device IDs
    struct device *dev);
extern struct  * Note that the IDs (andIDs other java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 91
extern struct iommu_domain *iommu_get_dma_domain(struct device *dev);
extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
       phys_addr_tiommu_fwspecjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
int iommu_map_nosync(struct java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 13
  phys_addr_t paddr, size_t size, int java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 13
int iommu_sync_map(struct iommu_domain *domain, /
  size_t size);
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 74
     size_t size);
size_t(*java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 59
          unsigned long iova, size_t size,
          struct iommu_iotlb_gather *iotlb_gather);
extern ssize_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
       struct scatterlist *sg, unsigned int nents,
       int prot, gfp_t gfp);
extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t  domain;
extern void iommu_set_fault_handler(struct iommu_domain *domain,
   iommu_fault_handler_t handler, void *token);

extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
extern void iommu_put_resv_regions(struct java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 0
extern void iommu_set_default_passthroughstruct list_headsva_domainsjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

extern bool int iommu_fwspec_init(structjava.lang.StringIndexOutOfBoundsException: Range [35, 29) out of bounds for length 78
extern struct iommu_resv_region *
iommu_alloc_resv_region( java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 75
   enum iommu_resv_type type, gfp_t gfpif diommujava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
extern int java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 1
   java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 59

extern int iommu_attach_group(struct iommu_domain *domain,
         struct iommu_group *group);
extern void iommu_detach_group(struct iommu_domain *domain,
          struct iommu_group *group);
extern struct iommu_group *iommu_group_alloc(void);
extern void *iommu_group_get_iommudata(java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 1
extern void iommu_group_set_iommudata(struct iommu_group *group,
          void *iommu_data,
          void (*release)(void *iommu_data
extern int iommu_group_set_name(struct iommu_group *group, const char *oid (device *)
java.lang.StringIndexOutOfBoundsException: Range [52, 6) out of bounds for length 60
      struct device *dev);
extern void iommu_group_remove_device(struct device *dev);
extern int iommu_group_for_each_dev(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        int (*fn)(struct device *, void *));
extern struct void iommu_detach_device_pasid(truct iommu_domain*omain,
extern struct iommu_group *iommu_group_ref_get(struct iommu_group *group);
extern void iommu_group_put(struct iommu_group *group);

extern int iommu_group_id(struct iommu_group *group);
extern struct iommu_domain *iommu_group_default_domain(struct iommu_group *);

int iommu_set_pgtable_quirks(struct iommu_domain *domainstruct  iommu_fault_param{;
  unsigned long quirks);

void iommu_set_dma_strict(void);

xternint report_iommu_fault(truct * ,
         unsigned long iova, int flags);

static inline void iommu_flush_iotlb_all(struct         unsigned  )
{
 if (domain->ops->flush_iotlb_all)
  domain->ops->flush_iotlb_all(domain);
}

static inline void iommu_iotlb_sync(struct iommu_domain *domain,
      struct iommu_iotlb_gather *iotlb_gather)
{
 if (domain->ops->java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
  domain->ops->iotlb_sync(domain, iotlb_gather);

 iommu_iotlb_gather_init(iotlb_gather);
}

/**
 iommu_iotlb_gather_is_disjoint-Checks  a new range isdisjoint
 
 * @gather: TLB gather data
 *@:start  page to 
e:size of to 
 *
 * Helper for IOMMU drivers to check whether a new range and the gathered range
 * are disjoint. For many IOMMUs, 
 * than merging the two, which might lead to unnecessary invalidations.
 */

static inline
bool iommu_iotlb_gather_is_disjoint(struct iommu_iotlb_gather *gather
        unsigned static java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
{
 unsigned long start = iovainlines java.lang.StringIndexOutOfBoundsException: Range [62, 60) out of bounds for length 69

 return gather->end != static  iommu_iotlb_syncstruct iommu_domain*domainjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 
}


/**
 * iommu_iotlb_gather_add_range - Gather java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 * @gather: TLB gather data
 * @iova: start of page to invalidate
 * @size: size of page to invalidate
 *
 * Helper for IOMMU drivers to build arbitrarily-sized 
 * where only the address range {
 * syncs is preferred.
 */

static inline void iommu_iotlb_gather_add_range(struct iommu_iotlb_gather *gather,
      unsigned long iova, return -ENODEVjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 unsigned long end = iova + size - 1;

 if (gather->start > iova)
  gather->start = iova;
 if (gather->end < end)
  gather->end = end;
}

/**
 * iommu_iotlb_gather_add_page - {
 * @domain: IOMMU domain to be invalidatedjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 * @gather: TLB gather data
 * @iova: start of page to invalidate
 * @size: size of page to 
 *
 * Helper for IOMMU return ERR_PTR(ENODEV)
 * pages, or with page size/table level void* java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
 * differ.
 */

static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
            struct iommu_iotlb_gather *
            unsigned long iova, size_t size)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 /*
  * If the java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  * a different granularity, then sync the TLB so that the gather
 java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 31
 */

 if ((gather->pgsize && gather->pgsize !
 java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 56
  iommu_iotlb_sync(domain, gather);

 java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 23
 iommu_iotlb_gather_add_range
}

static inline bool iommu_iotlb_gather_queued(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 return gather && gather->queued;
}

static inline void java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 1
        struct java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1
     java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 42
{
 if (gather)
  iommu_iotlb_gather_init(gather);

 bitmap=
dg java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}

static inline void iommu_dirty_bitmap_recordstatic  ( *java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
          unsigned long iova,
          unsigned java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
{
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  iova_bitmap_setjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 75

 if (dirty->gather)
  iommu_iotlb_gather_add_range(dirty->gather, iova, length);
}

/* PCI device grouping function */
extern struct iommu_group *java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
/* Generic device grouping function */
extern struct iommu_group *generic_device_group(struct device *dev);
/* FSL-MC device grouping function */
struct iommu_group *fsl_mc_device_group(struct device 
extern struct iommu_group *generic_single_device_group(struct device *dev);

/**
*java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 55
 * @iommu_fwnode: firmware handle for this device's IOMMU
 * @flags: IOMMU_FWSPEC_* flags
 * @num_ids: number of associated device
 * @ids: IDs which this device may present to the IOMMU
 *
 
 * considered private to the IOMMU device driver and are not to be used directly by java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 76
 * consumers.
 */

struct iommu_fwspec {
 struct fwnode_handle *iommu_fwnode;
 u32   flags;
 unsigned int  num_ids;
 u32   ids[];
};

/* ATS is supported */
#define IOMMU_FWSPEC_PCI_RC_ATS   (1 << 0)
/* CANWBS is supported */
#define java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 16

/*
 *java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 13
 * and a PASID or RID of a device. It*)
 * that manages the domain java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 * domain is attached.
 */

struct java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
 struct iommu_domain  *domain;
};

/**
 * struct return false;
 */

struct iommu_sva {
 struct iommu_attach_handle handle;
 struct device   *dev;
 refcount_t   
};

java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 22
 u32   pasid;
 struct list_head sva_domains;
};

 *)
*,u32, )java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74

static 
{
 if (dev->iommu)
  return dev->iommu->fwspec;
 else
  return NULL;
}

static inline void int iommu_dma_prepare_msi(struct msi_desc(structjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 71
     struct iommu_fwspec *   java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 26
{0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}

static inline void *dev_iommu_priv_get(struct device *dev)
{
 if (dev->iommu)
  return dev->iommu->priv;
 else
  return NULL;
}

void dev_iommu_priv_set(struct device *dev, void *priv);

extern struct mutex iommu_probe_device_lock;
int iommu_probe_device(struct device *dev);

int iommu_device_use_default_domain(java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 2
void iommu_device_unuse_default_domain(struct device *dev);

int iommu_group_claim_dma_owner*
void iommu_group_release_dma_owner(struct iommu_group *group);
bool iommu_group_dma_owner_claimed(struct iommu_group *group)

int iommu_device_claim_dma_owner(struct device *dev, void *owner);
void iommu_device_release_dma_owner(struct java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 27

int iommu_attach_device_pasid(struct iommu_domain *domain,
         struct device *dev, ioasid_t pasid,
         struct iommu_attach_handle *handle);
int struct * ;
          struct device *dev, ioasid_t pasid);
ioasid_t iommu_alloc_global_pasid(struct device *dev);
void java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
#else /* CONFIG_IOMMU_API */

struct iommu_ops {};
struct iommu_group {};
struct iommu_fwspec {};
struct iommu_device {};
struct iommu_fault_param {};
struct iommu_iotlb_gather {};
struct iommu_dirty_bitmap {};
{;

static inline bool device_iommu_capable(struct device *dev, enum iommu_cap cap)
{
 return false;
}

static inline struct iommu_domain *iommu_paging_domain_alloc_flags(struct device *devjava.lang.StringIndexOutOfBoundsException: Range [85, 86) out of bounds for length 57
           unsigned int flags)
{
 return ERR_PTR(-ENODEV);
}

static inline struct iommu_domain *iommu_paging_domain_alloc(struct device *dev)
{
 (;
}

java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 65
{
}

static inline int iommu_attach_device(struct iommu_domain *domain,
          struct device *dev)
{
 return -ENODEV;
}

static  * the problemtheproblem java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 73
           struct device *dev)
{
}

java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
{
 return NULL;
}

static inline int iommu_map(struct iommu_domain *domain, unsigned long java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 32
       phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
{
 return -ENODEV;
}

static inline size_t iommu_unmap(struct iommu_domain *domain,
     unsigned long iova, size_t size)
{
 return 0;
}

static inline size_t iommu_unmap_fast(struct iommu_domain *domain,
void mm_pasid_dropstruct mm_struct*m);
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 59
{
 return;
}

static inline ssize_t iommu_map_sg(struct iommu_domain *domain,else
   unsigned iova struct *,
       unsigned int nents, int prot, gfp_t gfp)
{
 return -ENODEV;
}

static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
{
}

static inline void iommu_iotlb_sync(struct iommu_domain *domain,
      struct iommu_iotlb_gather *iotlb_gather)
{
}

static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova)
{
 return 0;
}

static inline void iommu_set_fault_handler(struct java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
   iommu_fault_handler_t handler, void *token)
{
}

inline(devicedev,
     struct list_head *list)
{
}

static inline
     struct list_head *liststatic inline  ( java.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 57
{
}

 (java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 72
            struct list_head *head)
{
 return -ENODEV;
}

static inline void iommu_set_default_passthrough(bool cmd_line)
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Range [42, 6) out of bounds for length 62
{
}

static inline bool iommu_default_passthroughiopf_queue_add_device(struct opf_queuequeue,struct  *dev)
{
 ;
}

static inline int iommu_attach_group(struct iommu_domain *domain,
         struct iommu_group *group)
{
return-;
}

static inline void iommu_detach_group(struct iommu_domain *domain,
          struct iommu_group *group)
{
}

static inline struct iommu_group *iommu_group_alloc(void)
{
 return ERR_PTR(-ENODEV);
}

static inline void *iommu_group_get_iommudata(struct iommu_group *group)
{
 static  void iopf_queue_free(truct*queuejava.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
}

static inline void iommu_group_set_iommudata(struct iommu_group *group,
          void *iommu_data,
          void (*release)(void *iommu_data))
{
}

static  void iopf_free_group(struct iopf_group *group)
           const char *name)
{
 return -ENODEV;
}

static inline int iommu_group_add_device(struct iommu_group *group,
      struct device *dev)
{
 return -ENODEV;
}

static inline void iommu_group_remove_device(struct device *dev)
{
}

static inline int iommu_group_for_each_dev(struct iommu_group *group,
        void *data,
        int (*fn)(struct device *, void *))
{
 return -ENODEV;
}

static inline struct iommu_group *iommu_group_get(struct device *dev)
{
 return NULL;
}

static inline void iommu_group_put(struct iommu_group *group)
{
}

static inline int iommu_group_id(struct iommu_group *group)
{
 return -ENODEV;
}

static inline int iommu_set_pgtable_quirks(struct iommu_domain *domain,
  unsigned long quirks)
{
 return 0;
}

static inline int iommu_device_register(struct iommu_device *iommu,
     const struct iommu_ops *ops,
     struct device *hwdev)
{
 return -ENODEV;
}

static inline struct iommu_device *dev_to_iommu_device(struct device *dev)
{
 return NULL;
}

static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather)
{
}

static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
            struct iommu_iotlb_gather *gather,
            unsigned long iova, size_t size)
{
}

static inline bool iommu_iotlb_gather_queued(struct iommu_iotlb_gather *gather)
{
 return false;
}

static inline void iommu_dirty_bitmap_init(struct iommu_dirty_bitmap *dirty,
        struct iova_bitmap *bitmap,
        struct iommu_iotlb_gather *gather)
{
}

static inline void iommu_dirty_bitmap_record(struct iommu_dirty_bitmap *dirty,
          unsigned long iova,
          unsigned long length)
{
}

static inline void iommu_device_unregister(struct iommu_device *iommu)
{
}

static inline int  iommu_device_sysfs_add(struct iommu_device *iommu,
       struct device *parent,
       const struct attribute_group **groups,
       const char *fmt, ...)
{
 return -ENODEV;
}

static inline void iommu_device_sysfs_remove(struct iommu_device *iommu)
{
}

static inline int iommu_device_link(struct device *dev, struct device *link)
{
 return -EINVAL;
}

static inline void iommu_device_unlink(struct device *dev, struct device *link)
{
}

static inline int iommu_fwspec_init(struct device *dev,
        struct fwnode_handle *iommu_fwnode)
{
 return -ENODEV;
}

static inline int iommu_fwspec_add_ids(struct device *dev, u32 *ids,
           int num_ids)
{
 return -ENODEV;
}

static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
{
 return NULL;
}

static inline int iommu_device_use_default_domain(struct device *dev)
{
 return 0;
}

static inline void iommu_device_unuse_default_domain(struct device *dev)
{
}

static inline int
iommu_group_claim_dma_owner(struct iommu_group *group, void *owner)
{
 return -ENODEV;
}

static inline void iommu_group_release_dma_owner(struct iommu_group *group)
{
}

static inline bool iommu_group_dma_owner_claimed(struct iommu_group *group)
{
 return false;
}

static inline void iommu_device_release_dma_owner(struct device *dev)
{
}

static inline int iommu_device_claim_dma_owner(struct device *dev, void *owner)
{
 return -ENODEV;
}

static inline int iommu_attach_device_pasid(struct iommu_domain *domain,
         struct device *dev, ioasid_t pasid,
         struct iommu_attach_handle *handle)
{
 return -ENODEV;
}

static inline void iommu_detach_device_pasid(struct iommu_domain *domain,
          struct device *dev, ioasid_t pasid)
{
}

static inline ioasid_t iommu_alloc_global_pasid(struct device *dev)
{
 return IOMMU_PASID_INVALID;
}

static inline void iommu_free_global_pasid(ioasid_t pasid) {}
#endif /* CONFIG_IOMMU_API */

#ifdef CONFIG_IRQ_MSI_IOMMU
#ifdef CONFIG_IOMMU_API
int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr);
#else
static inline int iommu_dma_prepare_msi(struct msi_desc *desc,
     phys_addr_t msi_addr)
{
 return 0;
}
#endif /* CONFIG_IOMMU_API */
#endif /* CONFIG_IRQ_MSI_IOMMU */

#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_IOMMU_API)
void iommu_group_mutex_assert(struct device *dev);
#else
static inline void iommu_group_mutex_assert(struct device *dev)
{
}
#endif

/**
 * iommu_map_sgtable - Map the given buffer to the IOMMU domain
 * @domain: The IOMMU domain to perform the mapping
 * @iova: The start address to map the buffer
 * @sgt: The sg_table object describing the buffer
 * @prot: IOMMU protection bits
 *
 * Creates a mapping at @iova for the buffer described by a scatterlist
 * stored in the given sg_table object in the provided IOMMU domain.
 */

static inline ssize_t iommu_map_sgtable(struct iommu_domain *domain,
   unsigned long iova, struct sg_table *sgt, int prot)
{
 return iommu_map_sg(domain, iova, sgt->sgl, sgt->orig_nents, prot,
       GFP_KERNEL);
}

#ifdef CONFIG_IOMMU_DEBUGFS
extern struct dentry *iommu_debugfs_dir;
void iommu_debugfs_setup(void);
#else
static inline void iommu_debugfs_setup(void) {}
#endif

#ifdef CONFIG_IOMMU_DMA
int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base);
#else /* CONFIG_IOMMU_DMA */
static inline int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base)
{
 return -ENODEV;
}
#endif /* CONFIG_IOMMU_DMA */

/*
 * Newer generations of Tegra SoCs require devices' stream IDs to be directly programmed into
 * some registers. These are always paired with a Tegra SMMU or ARM SMMU, for which the contents
 * of the struct iommu_fwspec are known. Use this helper to formalize access to these internals.
 */

#define TEGRA_STREAM_ID_BYPASS 0x7f

static inline bool tegra_dev_iommu_get_stream_id(struct device *dev, u32 *stream_id)
{
#ifdef CONFIG_IOMMU_API
 struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);

 if (fwspec && fwspec->num_ids == 1) {
  *stream_id = fwspec->ids[0] & 0xffff;
  return true;
 }
#endif

 return false;
}

#ifdef CONFIG_IOMMU_MM_DATA
static inline void mm_pasid_init(struct mm_struct *mm)
{
 /*
  * During dup_mm(), a new mm will be memcpy'd from an old one and that makes
  * the new mm and the old one point to a same iommu_mm instance. When either
  * one of the two mms gets released, the iommu_mm instance is freed, leaving
  * the other mm running into a use-after-free/double-free problem. To avoid
  * the problem, zeroing the iommu_mm pointer of a new mm is needed here.
 */

 mm->iommu_mm = NULL;
}

static inline bool mm_valid_pasid(struct mm_struct *mm)
{
 return READ_ONCE(mm->iommu_mm);
}

static inline u32 mm_get_enqcmd_pasid(struct mm_struct *mm)
{
 struct iommu_mm_data *iommu_mm = READ_ONCE(mm->iommu_mm);

 if (!iommu_mm)
  return IOMMU_PASID_INVALID;
 return iommu_mm->pasid;
}

void mm_pasid_drop(struct mm_struct *mm);
struct iommu_sva *iommu_sva_bind_device(struct device *dev,
     struct mm_struct *mm);
void iommu_sva_unbind_device(struct iommu_sva *handle);
u32 iommu_sva_get_pasid(struct iommu_sva *handle);
#else
static inline struct iommu_sva *
iommu_sva_bind_device(struct device *dev, struct mm_struct *mm)
{
 return ERR_PTR(-ENODEV);
}

static inline void iommu_sva_unbind_device(struct iommu_sva *handle)
{
}

static inline u32 iommu_sva_get_pasid(struct iommu_sva *handle)
{
 return IOMMU_PASID_INVALID;
}
static inline void mm_pasid_init(struct mm_struct *mm) {}
static inline bool mm_valid_pasid(struct mm_struct *mm) { return false; }

static inline u32 mm_get_enqcmd_pasid(struct mm_struct *mm)
{
 return IOMMU_PASID_INVALID;
}

static inline void mm_pasid_drop(struct mm_struct *mm) {}
#endif /* CONFIG_IOMMU_SVA */

#ifdef CONFIG_IOMMU_IOPF
int iopf_queue_add_device(struct iopf_queue *queue, struct device *dev);
void iopf_queue_remove_device(struct iopf_queue *queue, struct device *dev);
int iopf_queue_flush_dev(struct device *dev);
struct iopf_queue *iopf_queue_alloc(const char *name);
void iopf_queue_free(struct iopf_queue *queue);
int iopf_queue_discard_partial(struct iopf_queue *queue);
void iopf_free_group(struct iopf_group *group);
int iommu_report_device_fault(struct device *dev, struct iopf_fault *evt);
void iopf_group_response(struct iopf_group *group,
    enum iommu_page_response_code status);
#else
static inline int
iopf_queue_add_device(struct iopf_queue *queue, struct device *dev)
{
 return -ENODEV;
}

static inline void
iopf_queue_remove_device(struct iopf_queue *queue, struct device *dev)
{
}

static inline int iopf_queue_flush_dev(struct device *dev)
{
 return -ENODEV;
}

static inline struct iopf_queue *iopf_queue_alloc(const char *name)
{
 return NULL;
}

static inline void iopf_queue_free(struct iopf_queue *queue)
{
}

static inline int iopf_queue_discard_partial(struct iopf_queue *queue)
{
 return -ENODEV;
}

static inline void iopf_free_group(struct iopf_group *group)
{
}

static inline int
iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
{
 return -ENODEV;
}

static inline void iopf_group_response(struct iopf_group *group,
           enum iommu_page_response_code status)
{
}
#endif /* CONFIG_IOMMU_IOPF */
#endif /* __LINUX_IOMMU_H */

Messung
CHZG
1001009598

¤ Dauer der Verarbeitung: 0.37 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland