[PATCH 2/6] x86: define FIXADDR_BOOT_* and redefine FIX_ADDR_SIZE - Kernel

This is a discussion on [PATCH 2/6] x86: define FIXADDR_BOOT_* and redefine FIX_ADDR_SIZE - Kernel ; Now, with these macros, x86_64 code can know where start the permanent and non-permanent fixed mapped address. This patch make these macros equal fixmap_32.h for future x86 integration. Signed-off-by: Gustavo F. Padovan Acked-by: Glauber Costa --- arch/x86/include/asm/fixmap_64.h | 7 +++++-- ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: [PATCH 2/6] x86: define FIXADDR_BOOT_* and redefine FIX_ADDR_SIZE

  1. [PATCH 2/6] x86: define FIXADDR_BOOT_* and redefine FIX_ADDR_SIZE

    Now, with these macros, x86_64 code can know where start the
    permanent and non-permanent fixed mapped address.
    This patch make these macros equal fixmap_32.h for future
    x86 integration.

    Signed-off-by: Gustavo F. Padovan
    Acked-by: Glauber Costa
    ---
    arch/x86/include/asm/fixmap_64.h | 7 +++++--
    1 files changed, 5 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/include/asm/fixmap_64.h b/arch/x86/include/asm/fixmap_64.h
    index 00a30ab..678b9c5 100644
    --- a/arch/x86/include/asm/fixmap_64.h
    +++ b/arch/x86/include/asm/fixmap_64.h
    @@ -73,8 +73,11 @@ enum fixed_addresses {
    };

    #define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
    -#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
    -#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
    +
    +#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
    +#define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
    +#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
    +#define FIXADDR_BOOT_START (FIXADDR_TOP - FIXADDR_BOOT_SIZE)

    /* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
    #define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
    --
    1.5.6.4

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [PATCH 4/6] x86: Add CONFIG_X86_{LOCAL,IO}_APIC

    Add CONFIG_X86_{LOCAL,IO}_APIC to enum fixed_address.
    FIX_APIC_BASE is used only when CONFIG_X86_LOCAL_APIC is
    enabled and FIX_IO_APIC_BASE_* are used only when
    CONFIG_X86_IO_APIC is enabled.

    Signed-off-by: Gustavo F. Padovan
    Acked-by: Glauber Costa
    ---
    arch/x86/include/asm/fixmap_64.h | 4 ++++
    1 files changed, 4 insertions(+), 0 deletions(-)

    diff --git a/arch/x86/include/asm/fixmap_64.h b/arch/x86/include/asm/fixmap_64.h
    index 773b657..8a328fc 100644
    --- a/arch/x86/include/asm/fixmap_64.h
    +++ b/arch/x86/include/asm/fixmap_64.h
    @@ -40,9 +40,13 @@ enum fixed_addresses {
    VSYSCALL_HPET,
    FIX_DBGP_BASE,
    FIX_EARLYCON_MEM_BASE,
    +#ifdef CONFIG_X86_LOCAL_APIC
    FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
    +#endif
    +#ifdef CONFIG_X86_IO_APIC
    FIX_IO_APIC_BASE_0,
    FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
    +#endif
    FIX_EFI_IO_MAP_LAST_PAGE,
    FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
    + MAX_EFI_IO_PAGES - 1,
    --
    1.5.6.4

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. [PATCH 5/6] x86: Add CONFIG_EFI

    FIX_EFI_IO_MAP_FIRST_PAGE is used only when EFI is enabled.

    Signed-off-by: Gustavo F. Padovan
    Acked-by: Glauber Costa
    ---
    arch/x86/include/asm/fixmap_64.h | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/arch/x86/include/asm/fixmap_64.h b/arch/x86/include/asm/fixmap_64.h
    index 8a328fc..5dc7941 100644
    --- a/arch/x86/include/asm/fixmap_64.h
    +++ b/arch/x86/include/asm/fixmap_64.h
    @@ -47,9 +47,11 @@ enum fixed_addresses {
    FIX_IO_APIC_BASE_0,
    FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
    #endif
    +#ifdef CONFIG_EFI
    FIX_EFI_IO_MAP_LAST_PAGE,
    FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
    + MAX_EFI_IO_PAGES - 1,
    +#endif
    #ifdef CONFIG_PARAVIRT
    FIX_PARAVIRT_BOOTMAP,
    #endif
    --
    1.5.6.4

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. [PATCH 3/6] x86: define reserve_top_address for x86_64

    Only for later x86 integration.

    Signed-off-by: Gustavo F. Padovan
    Acked-by: Glauber Costa
    ---
    arch/x86/include/asm/fixmap_64.h | 2 ++
    arch/x86/mm/pgtable.c | 18 ++++++++++++++++++
    arch/x86/mm/pgtable_32.c | 16 ----------------
    3 files changed, 20 insertions(+), 16 deletions(-)

    diff --git a/arch/x86/include/asm/fixmap_64.h b/arch/x86/include/asm/fixmap_64.h
    index 678b9c5..773b657 100644
    --- a/arch/x86/include/asm/fixmap_64.h
    +++ b/arch/x86/include/asm/fixmap_64.h
    @@ -72,6 +72,8 @@ enum fixed_addresses {
    __end_of_fixed_addresses
    };

    +extern void reserve_top_address(unsigned long reserve);
    +
    #define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)

    #define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
    diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
    index 86f2ffc..5b7c7c8 100644
    --- a/arch/x86/mm/pgtable.c
    +++ b/arch/x86/mm/pgtable.c
    @@ -313,6 +313,24 @@ int ptep_clear_flush_young(struct vm_area_struct *vma,
    return young;
    }

    +/**
    + * reserve_top_address - reserves a hole in the top of kernel address space
    + * @reserve - size of hole to reserve
    + *
    + * Can be used to relocate the fixmap area and poke a hole in the top
    + * of kernel address space to make room for a hypervisor.
    + */
    +void __init reserve_top_address(unsigned long reserve)
    +{
    +#ifdef CONFIG_X86_32
    + BUG_ON(fixmaps_set > 0);
    + printk(KERN_INFO "Reserving virtual address space above 0x%08x\n",
    + (int)-reserve);
    + __FIXADDR_TOP = -reserve - PAGE_SIZE;
    + __VMALLOC_RESERVE += reserve;
    +#endif
    +}
    +
    int fixmaps_set;

    void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
    diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
    index 0951db9..c3cf6e1 100644
    --- a/arch/x86/mm/pgtable_32.c
    +++ b/arch/x86/mm/pgtable_32.c
    @@ -97,22 +97,6 @@ void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags)
    unsigned long __FIXADDR_TOP = 0xfffff000;
    EXPORT_SYMBOL(__FIXADDR_TOP);

    -/**
    - * reserve_top_address - reserves a hole in the top of kernel address space
    - * @reserve - size of hole to reserve
    - *
    - * Can be used to relocate the fixmap area and poke a hole in the top
    - * of kernel address space to make room for a hypervisor.
    - */
    -void __init reserve_top_address(unsigned long reserve)
    -{
    - BUG_ON(fixmaps_set > 0);
    - printk(KERN_INFO "Reserving virtual address space above 0x%08x\n",
    - (int)-reserve);
    - __FIXADDR_TOP = -reserve - PAGE_SIZE;
    - __VMALLOC_RESERVE += reserve;
    -}
    -
    /*
    * vmalloc=size forces the vmalloc area to be exactly 'size'
    * bytes. This can be used to increase (or decrease) the
    --
    1.5.6.4

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread