aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c27
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c5
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/core/gnttab.c4
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/core/reboot.c4
-rw-r--r--linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h6
-rw-r--r--linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h6
-rw-r--r--linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h2
-rw-r--r--linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h6
-rw-r--r--unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h8
-rwxr-xr-xunmodified_drivers/linux-2.6/mkbuildtree1
-rw-r--r--xen/arch/x86/hvm/hvm.c31
-rw-r--r--xen/arch/x86/hvm/svm/svm.c4
-rw-r--r--xen/arch/x86/hvm/vmx/vmx.c4
14 files changed, 58 insertions, 52 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
index c052097889..195f06921a 100644
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
@@ -59,10 +59,6 @@
#include <xen/xenbus.h>
#include "common.h"
-#ifndef CONFIG_XEN
-#define scrub_pages(_p,_n)
-#endif
-
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *balloon_pde;
#endif
@@ -251,8 +247,6 @@ static int increase_reservation(unsigned long nr_pages)
return 0;
}
-extern void xen_invalidate_foreign_mappings(void);
-
static int decrease_reservation(unsigned long nr_pages)
{
unsigned long pfn, i, flags;
@@ -286,7 +280,7 @@ static int decrease_reservation(unsigned long nr_pages)
(unsigned long)v, __pte_ma(0), 0);
BUG_ON(ret);
}
-#ifdef CONFIG_XEN
+#ifdef CONFIG_XEN_SCRUB_PAGES
else {
v = kmap(page);
scrub_pages(v, 1);
@@ -306,13 +300,18 @@ static int decrease_reservation(unsigned long nr_pages)
/* No more mappings: invalidate P2M and add to balloon. */
for (i = 0; i < nr_pages; i++) {
pfn = mfn_to_pfn(frame_list[i]);
-#ifdef CONFIG_XEN
set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
-#endif
balloon_append(pfn_to_page(pfn));
}
- xen_invalidate_foreign_mappings();
+#ifndef CONFIG_XEN
+ /* XXX Temporary hack. */
+ {
+ extern void xen_invalidate_foreign_mappings(void);
+ xen_invalidate_foreign_mappings();
+ }
+#endif
+
set_xen_guest_handle(reservation.extent_start, frame_list);
reservation.nr_extents = nr_pages;
ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);
@@ -476,7 +475,7 @@ static int __init balloon_init(void)
bs.current_pages = min(xen_start_info->nr_pages, max_pfn);
totalram_pages = bs.current_pages;
#else
- bs.current_pages = totalram_pages;
+ bs.current_pages = totalram_pages;
#endif
bs.target_pages = bs.current_pages;
bs.balloon_low = 0;
@@ -592,9 +591,9 @@ struct page **alloc_empty_pages_and_pagevec(int nr_pages)
#ifdef CONFIG_XEN
ret = apply_to_page_range(&init_mm, vaddr, PAGE_SIZE,
dealloc_pte_fn, NULL);
-#else
- /* cannot handle non-auto translate mode */
- ret = 1;
+#else
+ /* Cannot handle non-auto translate mode. */
+ ret = 1;
#endif
}
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
index 2a263c0c75..283e17c3b9 100644
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
@@ -661,9 +661,10 @@ void do_blkif_request(request_queue_t *rq)
if (RING_FULL(&info->ring))
goto wait;
- DPRINTK("do_blk_req %p: cmd %p, sec %lx, "
+ DPRINTK("do_blk_req %p: cmd %p, sec %llx, "
"(%u/%li) buffer:%p [%s]\n",
- req, req->cmd, req->sector, req->current_nr_sectors,
+ req, req->cmd, (long long)req->sector,
+ req->current_nr_sectors,
req->nr_sectors, req->buffer,
rq_data_dir(req) ? "write" : "read");
diff --git a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
index 2b2d11f77b..07588d36a3 100644
--- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
+++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
@@ -407,13 +407,11 @@ grow_nomem:
static unsigned int __max_nr_grant_frames(void)
{
struct gnttab_query_size query;
- int rc = -1;
+ int rc;
query.dom = DOMID_SELF;
-#ifdef CONFIG_XEN
rc = HYPERVISOR_grant_table_op(GNTTABOP_query_size, &query, 1);
-#endif
if ((rc < 0) || (query.status != GNTST_okay))
return 4; /* Legacy max supported number of frames */
diff --git a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
index aa6215c93e..ffe05f47df 100644
--- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
+++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
@@ -9,6 +9,10 @@
#include <xen/xenbus.h>
#include <linux/kthread.h>
+#ifdef HAVE_XEN_PLATFORM_COMPAT_H
+#include <xen/platform-compat.h>
+#endif
+
MODULE_LICENSE("Dual BSD/GPL");
#define SHUTDOWN_INVALID -1
diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h
index 9bc4554b96..e9cc015efb 100644
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h
@@ -122,6 +122,12 @@ void xen_destroy_contiguous_region(
/* Turn jiffies into Xen system time. */
u64 jiffies_to_st(unsigned long jiffies);
+#ifdef CONFIG_XEN_SCRUB_PAGES
+#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
+#else
+#define scrub_pages(_p,_n) ((void)0)
+#endif
+
#include <asm/hypercall.h>
#if defined(CONFIG_X86_64)
diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h
index 8f3b7d8298..0f50556dd4 100644
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h
@@ -158,7 +158,7 @@ static inline paddr_t pte_machine_to_phys(maddr_t machine)
#define pfn_to_mfn(pfn) (pfn)
#define mfn_to_pfn(mfn) (mfn)
#define mfn_to_local_pfn(mfn) (mfn)
-#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn))
+#define set_phys_to_machine(pfn, mfn) ((void)0)
#define phys_to_machine_mapping_valid(pfn) (1)
#define phys_to_machine(phys) ((maddr_t)(phys))
#define machine_to_phys(mach) ((paddr_t)(mach))
diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h
index 5f7e40d725..29d41fc96e 100644
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h
@@ -45,12 +45,6 @@
})
#define HAVE_ARCH_FREE_PAGE
-#ifdef CONFIG_XEN_SCRUB_PAGES
-#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
-#else
-#define scrub_pages(_p,_n) ((void)0)
-#endif
-
#ifdef CONFIG_X86_USE_3DNOW
#include <asm/mmx.h>
diff --git a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h
index 2bbac7cb4e..cefd6e0b61 100644
--- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h
+++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h
@@ -140,7 +140,7 @@ static inline paddr_t pte_machine_to_phys(maddr_t machine)
#define pfn_to_mfn(pfn) (pfn)
#define mfn_to_pfn(mfn) (mfn)
#define mfn_to_local_pfn(mfn) (mfn)
-#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn))
+#define set_phys_to_machine(pfn, mfn) ((void)0)
#define phys_to_machine_mapping_valid(pfn) (1)
#define phys_to_machine(phys) ((maddr_t)(phys))
#define machine_to_phys(mach) ((paddr_t)(mach))
diff --git a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h
index 6340e6e6d6..2f9ef2a15b 100644
--- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h
+++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h
@@ -24,12 +24,6 @@
})
#define HAVE_ARCH_FREE_PAGE
-#ifdef CONFIG_XEN_SCRUB_PAGES
-#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
-#else
-#define scrub_pages(_p,_n) ((void)0)
-#endif
-
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#ifdef __ASSEMBLY__
diff --git a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
index 7493ddf382..d327d703ea 100644
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
@@ -25,6 +25,10 @@
#define NET_IP_ALIGN 0
#endif
+#if defined(_LINUX_SKBUFF_H) && !defined(CHECKSUM_HW)
+#define CHECKSUM_HW CHECKSUM_PARTIAL
+#endif
+
#if defined(_LINUX_ERR_H) && !defined(IS_ERR_VALUE)
#define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
#endif
@@ -76,6 +80,10 @@ extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
#endif
+#if defined(_LINUX_SYSRQ_H) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
+#define handle_sysrq(x,y,z) handle_sysrq(x,y)
+#endif
+
/*
* This variable at present is referenced by netfront, but only in code that
* is dead when running in hvm guests. To detect potential active uses of it
diff --git a/unmodified_drivers/linux-2.6/mkbuildtree b/unmodified_drivers/linux-2.6/mkbuildtree
index 31415928cd..b12da9b086 100755
--- a/unmodified_drivers/linux-2.6/mkbuildtree
+++ b/unmodified_drivers/linux-2.6/mkbuildtree
@@ -50,7 +50,6 @@ i[34567]86)
ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypercall.h include/asm
ln -sf ${XL}/include/asm-i386/mach-xen/asm/synch_bitops.h include/asm
ln -sf ${XL}/include/asm-i386/mach-xen/asm/maddr.h include/asm
- ln -sf ${XL}/include/asm-i386/mach-xen/asm/page.h include/asm
;;
"ia64")
ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 66478c5800..c68341662f 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -531,25 +531,22 @@ int hvm_do_hypercall(struct cpu_user_regs *pregs)
if ( (pregs->eax >= NR_hypercalls) || !hvm_hypercall_table[pregs->eax] )
{
- gdprintk(XENLOG_WARNING, "HVM vcpu %d:%d did a bad hypercall %d.\n",
- current->domain->domain_id, current->vcpu_id,
- pregs->eax);
+ if ( pregs->eax != __HYPERVISOR_grant_table_op )
+ gdprintk(XENLOG_WARNING, "HVM vcpu %d:%d bad hypercall %d.\n",
+ current->domain->domain_id, current->vcpu_id, pregs->eax);
pregs->eax = -ENOSYS;
return 0;
}
- /* Install a canary value in regs->eip so can check for continuation */
- pregs->eip |= 0xF;
+ /* Check for preemption: EIP will be modified from this dummy value. */
+ pregs->eip = 0xF0F0F0FF;
pregs->eax = hvm_hypercall_table[pregs->eax](
pregs->ebx, pregs->ecx, pregs->edx, pregs->esi, pregs->edi);
- /* XXX: pot fake IO instr here to inform the emulator to flush mapcache */
+ /* XXX: put fake IO instr here to inform the emulator to flush mapcache */
- if( (pregs->eip & 0xF) == 0 ) /* preempted */
- return 1;
-
- return 0;
+ return (pregs->eip != 0xF0F0F0FF); /* preempted? */
}
#else /* defined(__x86_64__) */
@@ -620,13 +617,16 @@ int hvm_do_hypercall(struct cpu_user_regs *pregs)
pregs->rax = (uint32_t)pregs->eax; /* mask in case compat32 caller */
if ( (pregs->rax >= NR_hypercalls) || !hvm_hypercall64_table[pregs->rax] )
{
- gdprintk(XENLOG_WARNING, "HVM vcpu %d:%d did a bad hypercall %ld.\n",
- current->domain->domain_id, current->vcpu_id,
- pregs->rax);
+ if ( pregs->rax != __HYPERVISOR_grant_table_op )
+ gdprintk(XENLOG_WARNING, "HVM vcpu %d:%d bad hypercall %ld.\n",
+ current->domain->domain_id, current->vcpu_id, pregs->rax);
pregs->rax = -ENOSYS;
return 0;
}
+ /* Check for preemption: RIP will be modified from this dummy value. */
+ pregs->rip = 0xF0F0F0FF;
+
if ( current->arch.paging.mode->guest_levels == 4 )
{
pregs->rax = hvm_hypercall64_table[pregs->rax](pregs->rdi,
@@ -643,7 +643,10 @@ int hvm_do_hypercall(struct cpu_user_regs *pregs)
(uint32_t)pregs->esi,
(uint32_t)pregs->edi);
}
- return 0; /* XXX SMH: fix for preempt here */
+
+ /* XXX: put fake IO instr here to inform the emulator to flush mapcache */
+
+ return (pregs->rip != 0xF0F0F0FF); /* preempted? */
}
#endif /* defined(__x86_64__) */
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 8b25f5019b..39c94bdb31 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2275,8 +2275,8 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
inst_len = __get_instruction_length(v, INSTR_VMCALL, NULL);
ASSERT(inst_len > 0);
HVMTRACE_1D(VMMCALL, v, regs->eax);
- if(hvm_do_hypercall(regs) == 0) /* not preempted */
- __update_guest_eip(vmcb, inst_len);
+ if ( !hvm_do_hypercall(regs) )
+ __update_guest_eip(vmcb, inst_len); /* not preempted */
break;
case VMEXIT_CR0_READ:
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index d7c700ca24..c618d3e886 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2628,8 +2628,8 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
{
HVMTRACE_1D(VMMCALL, v, regs->eax);
inst_len = __get_instruction_length(); /* Safe: VMCALL */
- if(hvm_do_hypercall(regs) == 0) /* not preempted */
- __update_guest_eip(inst_len);
+ if ( !hvm_do_hypercall(regs) )
+ __update_guest_eip(inst_len); /* preempted */
break;
}
case EXIT_REASON_CR_ACCESS: