~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/xen/arm/page.h

Version: ~ [ linux-5.10-rc5 ] ~ [ linux-5.9.10 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.79 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.159 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.208 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.245 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.245 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_ARM_XEN_PAGE_H
  3 #define _ASM_ARM_XEN_PAGE_H
  4 
  5 #include <asm/page.h>
  6 #include <asm/pgtable.h>
  7 
  8 #include <linux/pfn.h>
  9 #include <linux/types.h>
 10 #include <linux/dma-mapping.h>
 11 
 12 #include <xen/xen.h>
 13 #include <xen/interface/grant_table.h>
 14 
 15 #define phys_to_machine_mapping_valid(pfn) (1)
 16 
 17 /* Xen machine address */
 18 typedef struct xmaddr {
 19         phys_addr_t maddr;
 20 } xmaddr_t;
 21 
 22 /* Xen pseudo-physical address */
 23 typedef struct xpaddr {
 24         phys_addr_t paddr;
 25 } xpaddr_t;
 26 
 27 #define XMADDR(x)       ((xmaddr_t) { .maddr = (x) })
 28 #define XPADDR(x)       ((xpaddr_t) { .paddr = (x) })
 29 
 30 #define INVALID_P2M_ENTRY      (~0UL)
 31 
 32 /*
 33  * The pseudo-physical frame (pfn) used in all the helpers is always based
 34  * on Xen page granularity (i.e 4KB).
 35  *
 36  * A Linux page may be split across multiple non-contiguous Xen page so we
 37  * have to keep track with frame based on 4KB page granularity.
 38  *
 39  * PV drivers should never make a direct usage of those helpers (particularly
 40  * pfn_to_gfn and gfn_to_pfn).
 41  */
 42 
 43 unsigned long __pfn_to_mfn(unsigned long pfn);
 44 extern struct rb_root phys_to_mach;
 45 
 46 /* Pseudo-physical <-> Guest conversion */
 47 static inline unsigned long pfn_to_gfn(unsigned long pfn)
 48 {
 49         return pfn;
 50 }
 51 
 52 static inline unsigned long gfn_to_pfn(unsigned long gfn)
 53 {
 54         return gfn;
 55 }
 56 
 57 /* Pseudo-physical <-> BUS conversion */
 58 static inline unsigned long pfn_to_bfn(unsigned long pfn)
 59 {
 60         unsigned long mfn;
 61 
 62         if (phys_to_mach.rb_node != NULL) {
 63                 mfn = __pfn_to_mfn(pfn);
 64                 if (mfn != INVALID_P2M_ENTRY)
 65                         return mfn;
 66         }
 67 
 68         return pfn;
 69 }
 70 
 71 static inline unsigned long bfn_to_pfn(unsigned long bfn)
 72 {
 73         return bfn;
 74 }
 75 
 76 #define bfn_to_local_pfn(bfn)   bfn_to_pfn(bfn)
 77 
 78 /* VIRT <-> GUEST conversion */
 79 #define virt_to_gfn(v)          (pfn_to_gfn(virt_to_phys(v) >> XEN_PAGE_SHIFT))
 80 #define gfn_to_virt(m)          (__va(gfn_to_pfn(m) << XEN_PAGE_SHIFT))
 81 
 82 /* Only used in PV code. But ARM guests are always HVM. */
 83 static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
 84 {
 85         BUG();
 86 }
 87 
 88 extern int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
 89                                    struct gnttab_map_grant_ref *kmap_ops,
 90                                    struct page **pages, unsigned int count);
 91 
 92 extern int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
 93                                      struct gnttab_unmap_grant_ref *kunmap_ops,
 94                                      struct page **pages, unsigned int count);
 95 
 96 bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
 97 bool __set_phys_to_machine_multi(unsigned long pfn, unsigned long mfn,
 98                 unsigned long nr_pages);
 99 
100 static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
101 {
102         return __set_phys_to_machine(pfn, mfn);
103 }
104 
105 #define xen_remap(cookie, size) ioremap_cache((cookie), (size))
106 #define xen_unmap(cookie) iounmap((cookie))
107 
108 bool xen_arch_need_swiotlb(struct device *dev,
109                            phys_addr_t phys,
110                            dma_addr_t dev_addr);
111 unsigned long xen_get_swiotlb_free_pages(unsigned int order);
112 
113 #endif /* _ASM_ARM_XEN_PAGE_H */
114 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp