* [PATCH] x86: introduce clear_fixmap()
@ 2015-03-04 9:10 Jan Beulich
2015-03-04 9:58 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2015-03-04 9:10 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 2743 bytes --]
... making more obvious what its so far open coded users intend.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- 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) = 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)
if ( bad_ioapic_register(i) )
{
- __set_fixmap(idx, 0, 0);
+ clear_fixmap(idx);
continue;
}
--- 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);
}
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_
if ( --msix->table_refcnt[i] == 0 )
{
- __set_fixmap(idx, 0, 0);
+ clear_fixmap(idx);
msix_fixmap_free(idx);
msix->table_idx[i] = 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);
}
/* definitions from xen/drivers/passthrough/vtd/iommu.h
@@ -477,7 +477,7 @@ int __init tboot_parse_dmar_table(acpi_t
dmar_table_raw = xmalloc_array(unsigned char, dmar_table_length);
tboot_copy_memory(dmar_table_raw, dmar_table_length, pa);
dmar_table = (struct acpi_table_header *)dmar_table_raw;
- __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0);
+ clear_fixmap(FIX_TBOOT_MAP_ADDRESS);
rc = 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)
+#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)
[-- Attachment #2: x86-clear-fixmap.patch --]
[-- Type: text/plain, Size: 2770 bytes --]
x86: introduce clear_fixmap()
... making more obvious what its so far open coded users intend.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- 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) = 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)
if ( bad_ioapic_register(i) )
{
- __set_fixmap(idx, 0, 0);
+ clear_fixmap(idx);
continue;
}
--- 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);
}
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_
if ( --msix->table_refcnt[i] == 0 )
{
- __set_fixmap(idx, 0, 0);
+ clear_fixmap(idx);
msix_fixmap_free(idx);
msix->table_idx[i] = 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);
}
/* definitions from xen/drivers/passthrough/vtd/iommu.h
@@ -477,7 +477,7 @@ int __init tboot_parse_dmar_table(acpi_t
dmar_table_raw = xmalloc_array(unsigned char, dmar_table_length);
tboot_copy_memory(dmar_table_raw, dmar_table_length, pa);
dmar_table = (struct acpi_table_header *)dmar_table_raw;
- __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0);
+ clear_fixmap(FIX_TBOOT_MAP_ADDRESS);
rc = 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)
+#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)
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] x86: introduce clear_fixmap()
2015-03-04 9:10 [PATCH] x86: introduce clear_fixmap() Jan Beulich
@ 2015-03-04 9:58 ` Andrew Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2015-03-04 9:58 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Keir Fraser
[-- Attachment #1.1: Type: text/plain, Size: 3054 bytes --]
On 04/03/15 09:10, Jan Beulich wrote:
> ... making more obvious what its so far open coded users intend.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- 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) = 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)
>
> if ( bad_ioapic_register(i) )
> {
> - __set_fixmap(idx, 0, 0);
> + clear_fixmap(idx);
> continue;
> }
>
> --- 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);
> }
>
> 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_
>
> if ( --msix->table_refcnt[i] == 0 )
> {
> - __set_fixmap(idx, 0, 0);
> + clear_fixmap(idx);
> msix_fixmap_free(idx);
> msix->table_idx[i] = 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);
> }
>
> /* definitions from xen/drivers/passthrough/vtd/iommu.h
> @@ -477,7 +477,7 @@ int __init tboot_parse_dmar_table(acpi_t
> dmar_table_raw = xmalloc_array(unsigned char, dmar_table_length);
> tboot_copy_memory(dmar_table_raw, dmar_table_length, pa);
> dmar_table = (struct acpi_table_header *)dmar_table_raw;
> - __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0);
> + clear_fixmap(FIX_TBOOT_MAP_ADDRESS);
>
> rc = 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)
>
> +#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)
>
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 3854 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-04 9:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 9:10 [PATCH] x86: introduce clear_fixmap() Jan Beulich
2015-03-04 9:58 ` Andrew Cooper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.