From: "Jan Beulich" Subject: [PATCH] x86: introduce clear_fixmap() Date: Wed, 04 Mar 2015 09:10:22 +0000 Message-ID: <54F6DA0E02000078000660E1@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartEFDA40EE.1__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YT5Jw-0000aC-Hn for xen-devel@lists.xenproject.org; Wed, 04 Mar 2015 09:10:24 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Andrew Cooper , Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartEFDA40EE.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... making more obvious what its so far open coded users intend. Signed-off-by: Jan Beulich --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -310,7 +310,7 @@ void free_vcpu_guest_context(struct vcpu { if ( !per_cpu(vgc_pages[i], cpu) ) continue; - __set_fixmap(idx - i, 0, 0); + clear_fixmap(idx - i); free_domheap_page(per_cpu(vgc_pages[i], cpu)); per_cpu(vgc_pages[i], cpu) =3D NULL; } --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2552,7 +2552,7 @@ void __init init_ioapic_mappings(void) =20 if ( bad_ioapic_register(i) ) { - __set_fixmap(idx, 0, 0); + clear_fixmap(idx); continue; } =20 --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -541,7 +541,7 @@ static inline void __init construct_defa static __init void efi_unmap_mpf(void) { if (efi_enabled) - __set_fixmap(FIX_EFI_MPF, 0, 0); + clear_fixmap(FIX_EFI_MPF); } =20 static struct intel_mp_floating *__initdata mpf_found; --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -112,7 +112,7 @@ static void msix_put_fixmap(struct arch_ =20 if ( --msix->table_refcnt[i] =3D=3D 0 ) { - __set_fixmap(idx, 0, 0); + clear_fixmap(idx); msix_fixmap_free(idx); msix->table_idx[i] =3D 0; } --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -138,7 +138,7 @@ void __init tboot_probe(void) TXT_PUB_CONFIG_REGS_BASE + TXTCR_SINIT_BASE); tboot_copy_memory((unsigned char *)&sinit_size, sizeof(sinit_size), TXT_PUB_CONFIG_REGS_BASE + TXTCR_SINIT_SIZE); - __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0); + clear_fixmap(FIX_TBOOT_MAP_ADDRESS); } =20 /* definitions from xen/drivers/passthrough/vtd/iommu.h @@ -477,7 +477,7 @@ int __init tboot_parse_dmar_table(acpi_t dmar_table_raw =3D xmalloc_array(unsigned char, dmar_table_length); tboot_copy_memory(dmar_table_raw, dmar_table_length, pa); dmar_table =3D (struct acpi_table_header *)dmar_table_raw; - __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0); + clear_fixmap(FIX_TBOOT_MAP_ADDRESS); =20 rc =3D dmar_handler(dmar_table); xfree(dmar_table_raw); --- a/xen/include/asm-x86/fixmap.h +++ b/xen/include/asm-x86/fixmap.h @@ -78,6 +78,8 @@ extern void __set_fixmap( #define set_fixmap_nocache(idx, phys) \ __set_fixmap(idx, (phys)>>PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE) =20 +#define clear_fixmap(idx) __set_fixmap(idx, 0, 0) + #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) =20 --=__PartEFDA40EE.1__= Content-Type: text/plain; name="x86-clear-fixmap.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-clear-fixmap.patch" x86: introduce clear_fixmap()=0A=0A... making more obvious what its so far = open coded users intend.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/domain.c=0A+++ b/xen/arch/x86/domain.c=0A@@ = -310,7 +310,7 @@ void free_vcpu_guest_context(struct vcpu=0A {=0A = if ( !per_cpu(vgc_pages[i], cpu) )=0A continue;=0A- = __set_fixmap(idx - i, 0, 0);=0A+ clear_fixmap(idx - i);=0A = free_domheap_page(per_cpu(vgc_pages[i], cpu));=0A per_cpu(vgc_pages= [i], cpu) =3D NULL;=0A }=0A--- a/xen/arch/x86/io_apic.c=0A+++ = b/xen/arch/x86/io_apic.c=0A@@ -2552,7 +2552,7 @@ void __init init_ioapic_ma= ppings(void)=0A =0A if ( bad_ioapic_register(i) )=0A {=0A- = __set_fixmap(idx, 0, 0);=0A+ clear_fixmap(idx);=0A = continue;=0A }=0A =0A--- a/xen/arch/x86/mpparse.c=0A+++ = b/xen/arch/x86/mpparse.c=0A@@ -541,7 +541,7 @@ static inline void __init = construct_defa=0A static __init void efi_unmap_mpf(void)=0A {=0A if = (efi_enabled)=0A- __set_fixmap(FIX_EFI_MPF, 0, 0);=0A+ = clear_fixmap(FIX_EFI_MPF);=0A }=0A =0A static struct intel_mp_floating = *__initdata mpf_found;=0A--- a/xen/arch/x86/msi.c=0A+++ b/xen/arch/x86/msi.= c=0A@@ -112,7 +112,7 @@ static void msix_put_fixmap(struct arch_=0A =0A = if ( --msix->table_refcnt[i] =3D=3D 0 )=0A {=0A- __set_fixmap(i= dx, 0, 0);=0A+ clear_fixmap(idx);=0A msix_fixmap_free(idx);= =0A msix->table_idx[i] =3D 0;=0A }=0A--- a/xen/arch/x86/tboot.c= =0A+++ b/xen/arch/x86/tboot.c=0A@@ -138,7 +138,7 @@ void __init tboot_probe= (void)=0A TXT_PUB_CONFIG_REGS_BASE + TXTCR_SINIT_BASE= );=0A tboot_copy_memory((unsigned char *)&sinit_size, sizeof(sinit_size= ),=0A TXT_PUB_CONFIG_REGS_BASE + TXTCR_SINIT_SIZE);= =0A- __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0);=0A+ clear_fixmap(FIX_= TBOOT_MAP_ADDRESS);=0A }=0A =0A /* definitions from xen/drivers/passthrough= /vtd/iommu.h=0A@@ -477,7 +477,7 @@ int __init tboot_parse_dmar_table(acpi_t= =0A dmar_table_raw =3D xmalloc_array(unsigned char, dmar_table_length);= =0A tboot_copy_memory(dmar_table_raw, dmar_table_length, pa);=0A = dmar_table =3D (struct acpi_table_header *)dmar_table_raw;=0A- = __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0);=0A+ clear_fixmap(FIX_TBOOT_MA= P_ADDRESS);=0A =0A rc =3D dmar_handler(dmar_table);=0A xfree(dmar_t= able_raw);=0A--- a/xen/include/asm-x86/fixmap.h=0A+++ b/xen/include/asm-x86= /fixmap.h=0A@@ -78,6 +78,8 @@ extern void __set_fixmap(=0A #define = set_fixmap_nocache(idx, phys) \=0A __set_fixmap(idx, (phys)>>PAGE_SHIFT= , PAGE_HYPERVISOR_NOCACHE)=0A =0A+#define clear_fixmap(idx) __set_fixmap(id= x, 0, 0)=0A+=0A #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)= )=0A #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> = PAGE_SHIFT)=0A =0A --=__PartEFDA40EE.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartEFDA40EE.1__=--