Merge commit 'origin/x86/urgent' into x86/asm
This commit is contained in:
@@ -33,7 +33,7 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);
|
||||
#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \
|
||||
efi_call_virt(f, a1, a2, a3, a4, a5, a6)
|
||||
|
||||
#define efi_ioremap(addr, size) ioremap_cache(addr, size)
|
||||
#define efi_ioremap(addr, size, type) ioremap_cache(addr, size)
|
||||
|
||||
#else /* !CONFIG_X86_32 */
|
||||
|
||||
@@ -84,7 +84,8 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3,
|
||||
efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
|
||||
(u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))
|
||||
|
||||
extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size);
|
||||
extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
|
||||
u32 type);
|
||||
|
||||
#endif /* CONFIG_X86_32 */
|
||||
|
||||
|
@@ -12,9 +12,15 @@ static inline unsigned long native_save_fl(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
/*
|
||||
* Note: this needs to be "=r" not "=rm", because we have the
|
||||
* stack offset from what gcc expects at the time the "pop" is
|
||||
* executed, and so a memory reference with respect to the stack
|
||||
* would end up using the wrong address.
|
||||
*/
|
||||
asm volatile("# __raw_save_flags\n\t"
|
||||
"pushf ; pop %0"
|
||||
: "=g" (flags)
|
||||
: "=r" (flags)
|
||||
: /* no input */
|
||||
: "memory");
|
||||
|
||||
|
@@ -17,8 +17,7 @@
|
||||
/* Pages for switcher itself, then two pages per cpu */
|
||||
#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids)
|
||||
|
||||
/* We map at -4M (-2M when PAE is activated) for ease of mapping
|
||||
* into the guest (one PTE page). */
|
||||
/* We map at -4M (-2M for PAE) for ease of mapping (one PTE page). */
|
||||
#ifdef CONFIG_X86_PAE
|
||||
#define SWITCHER_ADDR 0xFFE00000
|
||||
#else
|
||||
|
@@ -30,27 +30,27 @@
|
||||
#include <asm/hw_irq.h>
|
||||
#include <asm/kvm_para.h>
|
||||
|
||||
/*G:030 But first, how does our Guest contact the Host to ask for privileged
|
||||
/*G:030
|
||||
* But first, how does our Guest contact the Host to ask for privileged
|
||||
* operations? There are two ways: the direct way is to make a "hypercall",
|
||||
* to make requests of the Host Itself.
|
||||
*
|
||||
* We use the KVM hypercall mechanism. Seventeen hypercalls are
|
||||
* available: the hypercall number is put in the %eax register, and the
|
||||
* arguments (when required) are placed in %ebx, %ecx, %edx and %esi.
|
||||
* If a return value makes sense, it's returned in %eax.
|
||||
* We use the KVM hypercall mechanism, though completely different hypercall
|
||||
* numbers. Seventeen hypercalls are available: the hypercall number is put in
|
||||
* the %eax register, and the arguments (when required) are placed in %ebx,
|
||||
* %ecx, %edx and %esi. If a return value makes sense, it's returned in %eax.
|
||||
*
|
||||
* Grossly invalid calls result in Sudden Death at the hands of the vengeful
|
||||
* Host, rather than returning failure. This reflects Winston Churchill's
|
||||
* definition of a gentleman: "someone who is only rude intentionally". */
|
||||
/*:*/
|
||||
* definition of a gentleman: "someone who is only rude intentionally".
|
||||
:*/
|
||||
|
||||
/* Can't use our min() macro here: needs to be a constant */
|
||||
#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
|
||||
|
||||
#define LHCALL_RING_SIZE 64
|
||||
struct hcall_args {
|
||||
/* These map directly onto eax, ebx, ecx, edx and esi
|
||||
* in struct lguest_regs */
|
||||
/* These map directly onto eax/ebx/ecx/edx/esi in struct lguest_regs */
|
||||
unsigned long arg0, arg1, arg2, arg3, arg4;
|
||||
};
|
||||
|
||||
|
@@ -46,7 +46,13 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte)
|
||||
__free_page(pte);
|
||||
}
|
||||
|
||||
extern void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte);
|
||||
extern void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte);
|
||||
|
||||
static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte,
|
||||
unsigned long address)
|
||||
{
|
||||
___pte_free_tlb(tlb, pte);
|
||||
}
|
||||
|
||||
static inline void pmd_populate_kernel(struct mm_struct *mm,
|
||||
pmd_t *pmd, pte_t *pte)
|
||||
@@ -78,7 +84,13 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
|
||||
free_page((unsigned long)pmd);
|
||||
}
|
||||
|
||||
extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
|
||||
extern void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
|
||||
|
||||
static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
|
||||
unsigned long adddress)
|
||||
{
|
||||
___pmd_free_tlb(tlb, pmd);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_PAE
|
||||
extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
|
||||
@@ -108,7 +120,14 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
|
||||
free_page((unsigned long)pud);
|
||||
}
|
||||
|
||||
extern void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud);
|
||||
extern void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud);
|
||||
|
||||
static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
|
||||
unsigned long address)
|
||||
{
|
||||
___pud_free_tlb(tlb, pud);
|
||||
}
|
||||
|
||||
#endif /* PAGETABLE_LEVELS > 3 */
|
||||
#endif /* PAGETABLE_LEVELS > 2 */
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define _ASM_X86_PGTABLE_H
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/e820.h>
|
||||
|
||||
#include <asm/pgtable_types.h>
|
||||
|
||||
@@ -269,9 +270,16 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
|
||||
|
||||
#define canon_pgprot(p) __pgprot(massage_pgprot(p))
|
||||
|
||||
static inline int is_new_memtype_allowed(unsigned long flags,
|
||||
unsigned long new_flags)
|
||||
static inline int is_new_memtype_allowed(u64 paddr, unsigned long size,
|
||||
unsigned long flags,
|
||||
unsigned long new_flags)
|
||||
{
|
||||
/*
|
||||
* PAT type is always WB for ISA. So no need to check.
|
||||
*/
|
||||
if (is_ISA_range(paddr, paddr + size - 1))
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* Certain new memtypes are not allowed with certain
|
||||
* requested memtype:
|
||||
|
@@ -212,9 +212,9 @@ extern int __get_user_bad(void);
|
||||
: "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
|
||||
#else
|
||||
#define __put_user_asm_u64(x, ptr, retval, errret) \
|
||||
__put_user_asm(x, ptr, retval, "q", "", "Zr", errret)
|
||||
__put_user_asm(x, ptr, retval, "q", "", "er", errret)
|
||||
#define __put_user_asm_ex_u64(x, addr) \
|
||||
__put_user_asm_ex(x, addr, "q", "", "Zr")
|
||||
__put_user_asm_ex(x, addr, "q", "", "er")
|
||||
#define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu)
|
||||
#endif
|
||||
|
||||
|
@@ -88,11 +88,11 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size)
|
||||
ret, "l", "k", "ir", 4);
|
||||
return ret;
|
||||
case 8:__put_user_asm(*(u64 *)src, (u64 __user *)dst,
|
||||
ret, "q", "", "ir", 8);
|
||||
ret, "q", "", "er", 8);
|
||||
return ret;
|
||||
case 10:
|
||||
__put_user_asm(*(u64 *)src, (u64 __user *)dst,
|
||||
ret, "q", "", "ir", 10);
|
||||
ret, "q", "", "er", 10);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
asm("":::"memory");
|
||||
@@ -101,12 +101,12 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size)
|
||||
return ret;
|
||||
case 16:
|
||||
__put_user_asm(*(u64 *)src, (u64 __user *)dst,
|
||||
ret, "q", "", "ir", 16);
|
||||
ret, "q", "", "er", 16);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
asm("":::"memory");
|
||||
__put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst,
|
||||
ret, "q", "", "ir", 8);
|
||||
ret, "q", "", "er", 8);
|
||||
return ret;
|
||||
default:
|
||||
return copy_user_generic((__force void *)dst, src, size);
|
||||
@@ -157,7 +157,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
|
||||
ret, "q", "", "=r", 8);
|
||||
if (likely(!ret))
|
||||
__put_user_asm(tmp, (u64 __user *)dst,
|
||||
ret, "q", "", "ir", 8);
|
||||
ret, "q", "", "er", 8);
|
||||
return ret;
|
||||
}
|
||||
default:
|
||||
|
@@ -133,7 +133,7 @@ struct bau_msg_payload {
|
||||
* see table 4.2.3.0.1 in broacast_assist spec.
|
||||
*/
|
||||
struct bau_msg_header {
|
||||
unsigned int dest_subnodeid:6; /* must be zero */
|
||||
unsigned int dest_subnodeid:6; /* must be 0x10, for the LB */
|
||||
/* bits 5:0 */
|
||||
unsigned int base_dest_nodeid:15; /* nasid>>1 (pnode) of */
|
||||
/* bits 20:6 */ /* first bit in node_map */
|
||||
|
@@ -175,7 +175,7 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
|
||||
#define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT))
|
||||
|
||||
#define UV_GLOBAL_MMR64_PNODE_BITS(p) \
|
||||
((unsigned long)(UV_PNODE_TO_GNODE(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT)
|
||||
(((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT)
|
||||
|
||||
#define UV_APIC_PNODE_SHIFT 6
|
||||
|
||||
@@ -327,6 +327,7 @@ struct uv_blade_info {
|
||||
unsigned short nr_possible_cpus;
|
||||
unsigned short nr_online_cpus;
|
||||
unsigned short pnode;
|
||||
short memory_nid;
|
||||
};
|
||||
extern struct uv_blade_info *uv_blade_info;
|
||||
extern short *uv_node_to_blade;
|
||||
@@ -363,6 +364,12 @@ static inline int uv_blade_to_pnode(int bid)
|
||||
return uv_blade_info[bid].pnode;
|
||||
}
|
||||
|
||||
/* Nid of memory node on blade. -1 if no blade-local memory */
|
||||
static inline int uv_blade_to_memory_nid(int bid)
|
||||
{
|
||||
return uv_blade_info[bid].memory_nid;
|
||||
}
|
||||
|
||||
/* Determine the number of possible cpus on a blade */
|
||||
static inline int uv_blade_nr_possible_cpus(int bid)
|
||||
{
|
||||
|
Reference in New Issue
Block a user