Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
xen.19021
xsa321-3.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsa321-3.patch of Package xen.19021
From: <security@xenproject.org> Subject: x86/iommu: introduce a cache sync hook The hook is only implemented for VT-d and it uses the already existing iommu_sync_cache function present in VT-d code. The new hook is added so that the cache can be flushed by code outside of VT-d when using shared page tables. Note that alloc_pgtable_maddr must use the now locally defined sync_cache function, because IOMMU ops are not yet setup the first time the function gets called during IOMMU initialization. No functional change intended. This is part of XSA-321. Reviewed-by: Jan Beulich <jbeulich@suse.com> --- a/xen/drivers/passthrough/vtd/extern.h +++ b/xen/drivers/passthrough/vtd/extern.h @@ -36,7 +36,6 @@ void disable_qinval(struct iommu *iommu) int enable_intremap(struct iommu *iommu, int eim); void disable_intremap(struct iommu *iommu); -void iommu_sync_cache(const void *addr, unsigned int size); int iommu_alloc(struct acpi_drhd_unit *drhd); void iommu_free(struct acpi_drhd_unit *drhd); --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -158,7 +158,7 @@ static void __init free_intel_iommu(stru static int iommus_incoherent; -void iommu_sync_cache(const void *addr, unsigned int size) +static void sync_cache(const void *addr, unsigned int size) { int i; static unsigned int clflush_size = 0; @@ -197,7 +197,7 @@ u64 alloc_pgtable_maddr(struct acpi_drhd vaddr = __map_domain_page(cur_pg); memset(vaddr, 0, PAGE_SIZE); - iommu_sync_cache(vaddr, PAGE_SIZE); + sync_cache(vaddr, PAGE_SIZE); unmap_domain_page(vaddr); cur_pg++; } @@ -2590,6 +2590,7 @@ const struct iommu_ops intel_iommu_ops = .iotlb_flush_all = intel_iommu_iotlb_flush_all, .get_reserved_device_memory = intel_iommu_get_reserved_device_memory, .dump_p2m_table = vtd_dump_p2m_table, + .sync_cache = sync_cache, }; /* --- a/xen/include/asm-x86/iommu.h +++ b/xen/include/asm-x86/iommu.h @@ -34,6 +34,13 @@ void iommu_disable_x2apic_IR(void); int pi_update_irte(const struct vcpu *v, const struct pirq *pirq, const uint8_t gvec); +#define iommu_sync_cache(addr, size) ({ \ + const struct iommu_ops *ops = iommu_get_ops(); \ + \ + if ( ops->sync_cache ) \ + ops->sync_cache(addr, size); \ +}) + #endif /* !__ARCH_X86_IOMMU_H__ */ /* * Local variables: --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -174,6 +174,7 @@ struct iommu_ops { void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, unsigned int value); unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg); int (*setup_hpet_msi)(struct msi_desc *); + void (*sync_cache)(const void *addr, unsigned int size); #endif /* CONFIG_X86 */ void (*suspend)(void); void (*resume)(void);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor