|
20 | 20 | #include <linux/bitops.h> |
21 | 21 | #include <linux/dma-mapping.h> |
22 | 22 | #include <linux/virtio_config.h> |
23 | | -#include <linux/virtio_anchor.h> |
24 | 23 | #include <linux/cc_platform.h> |
25 | 24 |
|
26 | 25 | #include <asm/tlbflush.h> |
@@ -215,40 +214,6 @@ void __init sme_map_bootdata(char *real_mode_data) |
215 | 214 | __sme_early_map_unmap_mem(__va(cmdline_paddr), COMMAND_LINE_SIZE, true); |
216 | 215 | } |
217 | 216 |
|
218 | | -void __init sev_setup_arch(void) |
219 | | -{ |
220 | | - phys_addr_t total_mem = memblock_phys_mem_size(); |
221 | | - unsigned long size; |
222 | | - |
223 | | - if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) |
224 | | - return; |
225 | | - |
226 | | - /* |
227 | | - * For SEV, all DMA has to occur via shared/unencrypted pages. |
228 | | - * SEV uses SWIOTLB to make this happen without changing device |
229 | | - * drivers. However, depending on the workload being run, the |
230 | | - * default 64MB of SWIOTLB may not be enough and SWIOTLB may |
231 | | - * run out of buffers for DMA, resulting in I/O errors and/or |
232 | | - * performance degradation especially with high I/O workloads. |
233 | | - * |
234 | | - * Adjust the default size of SWIOTLB for SEV guests using |
235 | | - * a percentage of guest memory for SWIOTLB buffers. |
236 | | - * Also, as the SWIOTLB bounce buffer memory is allocated |
237 | | - * from low memory, ensure that the adjusted size is within |
238 | | - * the limits of low available memory. |
239 | | - * |
240 | | - * The percentage of guest memory used here for SWIOTLB buffers |
241 | | - * is more of an approximation of the static adjustment which |
242 | | - * 64MB for <1G, and ~128M to 256M for 1G-to-4G, i.e., the 6% |
243 | | - */ |
244 | | - size = total_mem * 6 / 100; |
245 | | - size = clamp_val(size, IO_TLB_DEFAULT_SIZE, SZ_1G); |
246 | | - swiotlb_adjust_size(size); |
247 | | - |
248 | | - /* Set restricted memory access for virtio. */ |
249 | | - virtio_set_mem_acc_cb(virtio_require_restricted_mem_acc); |
250 | | -} |
251 | | - |
252 | 217 | static unsigned long pg_level_to_pfn(int level, pte_t *kpte, pgprot_t *ret_prot) |
253 | 218 | { |
254 | 219 | unsigned long pfn = 0; |
|
0 commit comments