hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/io.h
....@@ -90,8 +90,6 @@
9090 #define __raw_writew __writew
9191 #define __raw_writel __writel
9292
93
-#define mmiowb() barrier()
94
-
9593 #ifdef CONFIG_X86_64
9694
9795 build_mmio_read(readq, "q", u64, "=r", :"memory")
....@@ -167,7 +165,6 @@
167165 {
168166 return (unsigned int)virt_to_phys(address);
169167 }
170
-#define isa_page_to_bus(page) ((unsigned int)page_to_phys(page))
171168 #define isa_bus_to_virt phys_to_virt
172169
173170 /*
....@@ -183,15 +180,14 @@
183180 * The default ioremap() behavior is non-cached; if you need something
184181 * else, you probably want one of the following.
185182 */
186
-extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
187
-#define ioremap_nocache ioremap_nocache
188183 extern void __iomem *ioremap_uc(resource_size_t offset, unsigned long size);
189184 #define ioremap_uc ioremap_uc
190
-
191185 extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
192186 #define ioremap_cache ioremap_cache
193187 extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size, unsigned long prot_val);
194188 #define ioremap_prot ioremap_prot
189
+extern void __iomem *ioremap_encrypted(resource_size_t phys_addr, unsigned long size);
190
+#define ioremap_encrypted ioremap_encrypted
195191
196192 /**
197193 * ioremap - map bus memory into CPU space
....@@ -207,10 +203,7 @@
207203 * If the area you are trying to map is a PCI BAR you should have a
208204 * look at pci_iomap().
209205 */
210
-static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
211
-{
212
- return ioremap_nocache(offset, size);
213
-}
206
+void __iomem *ioremap(resource_size_t offset, unsigned long size);
214207 #define ioremap ioremap
215208
216209 extern void iounmap(volatile void __iomem *addr);
....@@ -219,6 +212,14 @@
219212 extern void set_iounmap_nonlazy(void);
220213
221214 #ifdef __KERNEL__
215
+
216
+void memcpy_fromio(void *, const volatile void __iomem *, size_t);
217
+void memcpy_toio(volatile void __iomem *, const void *, size_t);
218
+void memset_io(volatile void __iomem *, int, size_t);
219
+
220
+#define memcpy_fromio memcpy_fromio
221
+#define memcpy_toio memcpy_toio
222
+#define memset_io memset_io
222223
223224 #include <asm-generic/iomap.h>
224225
....@@ -369,18 +370,6 @@
369370
370371 extern bool is_early_ioremap_ptep(pte_t *ptep);
371372
372
-#ifdef CONFIG_XEN
373
-#include <xen/xen.h>
374
-struct bio_vec;
375
-
376
-extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
377
- const struct bio_vec *vec2);
378
-
379
-#define BIOVEC_PHYS_MERGEABLE(vec1, vec2) \
380
- (__BIOVEC_PHYS_MERGEABLE(vec1, vec2) && \
381
- (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
382
-#endif /* CONFIG_XEN */
383
-
384373 #define IO_SPACE_LIMIT 0xffff
385374
386375 #include <asm-generic/io.h>
....@@ -410,4 +399,29 @@
410399 extern bool phys_mem_access_encrypted(unsigned long phys_addr,
411400 unsigned long size);
412401
402
+/**
403
+ * iosubmit_cmds512 - copy data to single MMIO location, in 512-bit units
404
+ * @dst: destination, in MMIO space (must be 512-bit aligned)
405
+ * @src: source
406
+ * @count: number of 512 bits quantities to submit
407
+ *
408
+ * Submit data from kernel space to MMIO space, in units of 512 bits at a
409
+ * time. Order of access is not guaranteed, nor is a memory barrier
410
+ * performed afterwards.
411
+ *
412
+ * Warning: Do not use this helper unless your driver has checked that the CPU
413
+ * instruction is supported on the platform.
414
+ */
415
+static inline void iosubmit_cmds512(void __iomem *dst, const void *src,
416
+ size_t count)
417
+{
418
+ const u8 *from = src;
419
+ const u8 *end = from + count * 64;
420
+
421
+ while (from < end) {
422
+ movdir64b(dst, from);
423
+ from += 64;
424
+ }
425
+}
426
+
413427 #endif /* _ASM_X86_IO_H */