SHA256
1
0
forked from pool/xen

- fate#310510 - fix xenpaging

xenpaging.doc.patch
- add /var/lib/xen/xenpaging directory

- fate#310510 - fix xenpaging
  xenpaging.memory_op.patch, correct delay handling in retry loop

- Some cleanup in the APIC handling code in the HyperV shim.
  hv_apic.patch

- bnc#640370 - VM graphic console in VNC is corrupted
  xenfb_32bpp.patch

- fate#310510 - fix xenpaging
  xenpaging.autostart_delay.patch
  delay start of xenpaging 7 seconds for smooth BIOS startup

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=79
This commit is contained in:
Charles Arnold 2010-10-29 16:37:40 +00:00 committed by Git OBS Bridge
parent e7d6982b78
commit 5731fa8ced
12 changed files with 363 additions and 61 deletions

149
hv_apic.patch Normal file
View File

@ -0,0 +1,149 @@
Cleanup some APIC handling code in the HyperV shim.
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Index: xen-4.0.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/hvm/hyperv/hv_intercept.c 2010-10-04 14:04:46.000000000 -0600
+++ xen-4.0.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c 2010-10-04 18:30:42.000000000 -0600
@@ -252,71 +252,6 @@ hv_get_max_vcpus_supported(void)
static inline void
-hv_read_icr(u64 *icr_content)
-{
- unsigned long icr_low, icr_high;
-
- icr_low = vlapic_mmio_handler.read_handler(current,
- (vlapic_base_address(vcpu_vlapic(current)) + APIC_ICR), 4, &icr_low);
- icr_high = vlapic_mmio_handler.read_handler(current,
- (vlapic_base_address(vcpu_vlapic(current)) + APIC_ICR2), 4, &icr_high);
- *icr_content = (((u64)icr_high<< 32) | icr_low);
-
-}
-
-static inline void
-hv_read_tpr(u64 *tpr_content)
-{
-
- vlapic_mmio_handler.read_handler(current,
- (vlapic_base_address(vcpu_vlapic(current)) + APIC_TASKPRI),
- 4, (unsigned long *)&tpr_content);
-}
-
-static inline void
-hv_write_eoi(u64 msr_content)
-{
- u32 eoi = (u32)msr_content;
-
- vlapic_mmio_handler.write_handler(current,
- (vlapic_base_address(vcpu_vlapic(current)) + APIC_EOI), 4, eoi);
-
-}
-
-static inline void
-hv_write_icr(u64 msr_content)
-{
- u32 icr_low, icr_high;
- icr_low = (u32)msr_content;
- icr_high = (u32)(msr_content >> 32);
-
- if (icr_high != 0)
- {
- vlapic_mmio_handler.write_handler(current,
- (vlapic_base_address(vcpu_vlapic(current)) + APIC_ICR2), 4,
- icr_high);
- }
- if (icr_low != 0)
- {
- vlapic_mmio_handler.write_handler(current,
- (vlapic_base_address(vcpu_vlapic(current)) + APIC_ICR), 4,
- icr_low);
- }
-
-}
-
-static inline void
-hv_write_tpr(u64 msr_content)
-{
- u32 tpr = (u32)msr_content;
-
-
- vlapic_mmio_handler.write_handler(current,
- (vlapic_base_address(vcpu_vlapic(current)) + APIC_TASKPRI), 4, tpr);
-
-}
-
-static inline void
hv_hypercall_page_initialize(void *hypercall_page)
{
char *p;
@@ -810,21 +745,14 @@ hyperv_do_rd_msr(uint32_t idx, struct cp
regs->edx = (u32)(0x0);
break;
case HV_MSR_ICR:
- if (!hv_privilege_check(curp, HV_ACCESS_APIC_MSRS)) {
- goto msr_read_error;
- }
- hv_read_icr(&msr_content);
+ regs->eax = vlapic_get_reg(vcpu_vlapic(current), APIC_ICR);
+ regs->edx = vlapic_get_reg(vcpu_vlapic(current), APIC_ICR2);
#ifdef HV_STATS
cur_vcpu->stats.num_icr_reads++;
#endif
- regs->eax = (u32)(msr_content & 0xFFFFFFFF);
- regs->edx = (u32)(msr_content >> 32);
break;
case HV_MSR_TPR:
- if (!hv_privilege_check(curp, HV_ACCESS_APIC_MSRS)) {
- goto msr_read_error;
- }
- hv_read_tpr(&msr_content);
+ msr_content = vlapic_get_reg(vcpu_vlapic(current), APIC_TASKPRI);
#ifdef HV_STATS
cur_vcpu->stats.num_tpr_reads++;
#endif
@@ -922,28 +850,30 @@ hyperv_do_wr_msr(uint32_t idx, struct cp
goto msr_write_error;
case HV_MSR_EOI:
- if (!hv_privilege_check(curp, HV_ACCESS_APIC_MSRS)) {
- goto msr_write_error;
- }
- hv_write_eoi(msr_content);
+ vlapic_EOI_set(vcpu_vlapic(current));
#ifdef HV_STATS
cur_vcpu->stats.num_eoi_writes++;
#endif
break;
- case HV_MSR_ICR:
- if (!hv_privilege_check(curp, HV_ACCESS_APIC_MSRS)) {
- goto msr_write_error;
- }
- hv_write_icr(msr_content);
+ case HV_MSR_ICR: {
+ u32 eax = (u32)msr_content;
+ u32 edx = (u32)(msr_content >> 32);
+ struct vlapic *vlapic = vcpu_vlapic(current);
+ eax &= ~(1 << 12);
+ edx &= 0xff000000;
+ vlapic_set_reg(vlapic, APIC_ICR2, edx);
+ if ( vlapic_ipi(vlapic, eax, edx) == X86EMUL_OKAY )
+ vlapic_set_reg(vlapic, APIC_ICR, eax);
+ break;
+ }
+
#ifdef HV_STATS
cur_vcpu->stats.num_icr_writes++;
#endif
break;
case HV_MSR_TPR:
- if (!hv_privilege_check(curp, HV_ACCESS_APIC_MSRS)) {
- goto msr_write_error;
- }
- hv_write_tpr(msr_content);
+ vlapic_set_reg(vcpu_vlapic(current), APIC_TASKPRI,
+ (uint8_t)msr_content);
#ifdef HV_STATS
cur_vcpu->stats.num_tpr_writes++;
#endif

View File

@ -1,3 +1,35 @@
-------------------------------------------------------------------
Wed Oct 27 20:08:51 CEST 2010 - ohering@suse.de
- fate#310510 - fix xenpaging
xenpaging.doc.patch
- add /var/lib/xen/xenpaging directory
-------------------------------------------------------------------
Wed Oct 27 18:04:30 CEST 2010 - ohering@suse.de
- fate#310510 - fix xenpaging
xenpaging.memory_op.patch, correct delay handling in retry loop
-------------------------------------------------------------------
Wed Oct 27 08:50:17 MDT 2010 - ksrinivasan@novell.com
- Some cleanup in the APIC handling code in the HyperV shim.
hv_apic.patch
-------------------------------------------------------------------
Wed Oct 27 03:56:38 EDT 2010 - cyliu@novell.com
- bnc#640370 - VM graphic console in VNC is corrupted
xenfb_32bpp.patch
-------------------------------------------------------------------
Fri Oct 22 13:34:54 CEST 2010 - ohering@suse.de
- fate#310510 - fix xenpaging
xenpaging.autostart_delay.patch
delay start of xenpaging 7 seconds for smooth BIOS startup
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Oct 20 15:50:01 CEST 2010 - ohering@suse.de Wed Oct 20 15:50:01 CEST 2010 - ohering@suse.de

View File

@ -229,6 +229,7 @@ Patch433: multi-xvdp.patch
Patch434: check_device_status.patch Patch434: check_device_status.patch
Patch435: change_home_server.patch Patch435: change_home_server.patch
Patch436: altgr_2.patch Patch436: altgr_2.patch
Patch437: xenfb_32bpp.patch
# Jim's domain lock patch # Jim's domain lock patch
Patch450: xend-domain-lock.patch Patch450: xend-domain-lock.patch
# Hypervisor and PV driver Patches # Hypervisor and PV driver Patches
@ -252,12 +253,15 @@ Patch700: hv_tools.patch
Patch701: hv_xen_base.patch Patch701: hv_xen_base.patch
Patch702: hv_xen_extension.patch Patch702: hv_xen_extension.patch
Patch703: hv_win7_eoi_bug.patch Patch703: hv_win7_eoi_bug.patch
Patch704: hv_apic.patch
# Build patch # Build patch
Patch999: tmp_build.patch Patch999: tmp_build.patch
# FATE 310510 # FATE 310510
Patch10001: xenpaging.tools_xenpaging_cleanup.patch Patch10001: xenpaging.tools_xenpaging_cleanup.patch
Patch10002: xenpaging.pageout_policy.patch Patch10002: xenpaging.pageout_policy.patch
Patch10003: xenpaging.xs_daemon_close.patch Patch10003: xenpaging.xs_daemon_close.patch
Patch10004: xenpaging.get_paged_frame.patch
Patch10005: xenpaging.makefile.patch
Patch10010: xenpaging.policy_linear.patch Patch10010: xenpaging.policy_linear.patch
Patch10011: xenpaging.pagefile.patch Patch10011: xenpaging.pagefile.patch
Patch10012: xenpaging.xenpaging_init.patch Patch10012: xenpaging.xenpaging_init.patch
@ -267,11 +271,10 @@ Patch10015: xenpaging.populate_only_if_paged.patch
Patch10017: xenpaging.autostart.patch Patch10017: xenpaging.autostart.patch
Patch10018: xenpaging.signal_handling.patch Patch10018: xenpaging.signal_handling.patch
Patch10019: xenpaging.MRU_SIZE.patch Patch10019: xenpaging.MRU_SIZE.patch
Patch10020: xenpaging.get_paged_frame.patch
Patch10021: xenpaging.mem_event_check_ring-free_requests.patch Patch10021: xenpaging.mem_event_check_ring-free_requests.patch
Patch10022: xenpaging.blacklist.patch Patch10022: xenpaging.blacklist.patch
Patch10023: xenpaging.autostart_delay.patch Patch10023: xenpaging.autostart_delay.patch
Patch10024: xenpaging.makefile.patch Patch10040: xenpaging.doc.patch
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
#%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()") #%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
@ -726,6 +729,7 @@ Authors:
%patch434 -p1 %patch434 -p1
%patch435 -p1 %patch435 -p1
%patch436 -p1 %patch436 -p1
%patch437 -p1
%patch450 -p1 %patch450 -p1
%patch500 -p1 %patch500 -p1
%patch501 -p1 %patch501 -p1
@ -746,10 +750,13 @@ Authors:
%patch701 -p1 %patch701 -p1
%patch702 -p1 %patch702 -p1
%patch703 -p1 %patch703 -p1
%patch704 -p1
%patch999 -p1 %patch999 -p1
%patch10001 -p1 %patch10001 -p1
%patch10002 -p1 %patch10002 -p1
%patch10003 -p1 %patch10003 -p1
%patch10004 -p1
%patch10005 -p1
%patch10010 -p1 %patch10010 -p1
%patch10011 -p1 %patch10011 -p1
%patch10012 -p1 %patch10012 -p1
@ -759,11 +766,11 @@ Authors:
%patch10017 -p1 %patch10017 -p1
%patch10018 -p1 %patch10018 -p1
%patch10019 -p1 %patch10019 -p1
%patch10020 -p1
%patch10021 -p1 %patch10021 -p1
%patch10022 -p1 %patch10022 -p1
%patch10023 -p1 %patch10023 -p1
%patch10024 -p1 %patch10040 -p1
%build %build
XEN_EXTRAVERSION=%version-%release XEN_EXTRAVERSION=%version-%release
@ -859,7 +866,7 @@ for name in COPYING %SOURCE2 %SOURCE3 %SOURCE4; do
install -m 644 $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ install -m 644 $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/
done done
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc
for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt; do for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt xenpaging.txt; do
install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/ install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/
done done
# init scripts # init scripts
@ -902,6 +909,7 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/xen/dump
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xenpaging
mkdir -p $RPM_BUILD_ROOT/var/log/xen mkdir -p $RPM_BUILD_ROOT/var/log/xen
ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
# Bootloader # Bootloader
@ -1017,6 +1025,7 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
%dir %attr(700,root,root) /var/lib/xen/images %dir %attr(700,root,root) /var/lib/xen/images
%dir %attr(700,root,root) /var/lib/xen/save %dir %attr(700,root,root) /var/lib/xen/save
%dir %attr(700,root,root) /var/lib/xen/dump %dir %attr(700,root,root) /var/lib/xen/dump
%dir %attr(700,root,root) /var/lib/xen/xenpaging
%dir /var/lib/xen/xend-db %dir /var/lib/xen/xend-db
%dir /var/lib/xen/xend-db/domain %dir /var/lib/xen/xend-db/domain
%dir /var/lib/xen/xend-db/migrate %dir /var/lib/xen/xend-db/migrate

41
xenfb_32bpp.patch Normal file
View File

@ -0,0 +1,41 @@
Fix problem that press CTRL+ALT+2 and then CTRL+ALT+1 back to VM graphic console, screen cannot be restored.
xenfb_guest_copy only handles xenfb->depth=8 and 24 cases, because it assumes in xenfb->depth=16 or 32 cases,
buffer is shared, like in xenfb_update ==> qemu_create_displaysurface_from() does. But as the mentioned bug,
it didn't enter the xenfb_update do_resize hunk, buffer is not shared.
To solve that problem, either make it enter the xenfb_update do_resize hunk, or change xenfb_guest_copy(), let
it handle all cases. This patch is to let xenfb_guest_copy handle xenfb->depth=32 case.
diff -r e4f337bb97f7 tools/ioemu-qemu-xen/hw/xenfb.c
--- a/tools/ioemu-qemu-xen/hw/xenfb.c Wed Oct 20 19:39:28 2010 +0800
+++ b/tools/ioemu-qemu-xen/hw/xenfb.c Wed Oct 20 21:42:37 2010 +0800
@@ -612,6 +612,12 @@
uint8_t *data = ds_get_data(xenfb->c.ds);
if (!is_buffer_shared(xenfb->c.ds->surface)) {
+ if (xenfb->depth == bpp) {
+ for (line = y; line < (y+h); line++) {
+ memcpy (data + (line * linesize) + (x * bpp / 8), xenfb->pixels + xenfb->offset + (line * xenfb->row_stride) + (x * xenfb->depth / 8), w * xenfb->depth / 8);
+ }
+ }
+ else{
switch (xenfb->depth) {
case 8:
if (bpp == 16) {
@@ -631,9 +637,17 @@
oops = 1;
}
break;
+ case 32:
+ if (bpp == 16) {
+ BLT(uint32_t, uint16_t, 8, 8, 8, 5, 6, 5);
+ } else {
+ oops = 1;
+ }
+ break;
default:
oops = 1;
}
+ }
}
if (oops) /* should not happen */
xen_be_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n",

View File

@ -24,7 +24,7 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
+ if self.xenpaging_delay == None: + if self.xenpaging_delay == None:
+ log.warn("XXX creating /local/domain/0/xenpaging/%s" % self.vm.info['name_label']) + log.warn("XXX creating /local/domain/0/xenpaging/%s" % self.vm.info['name_label'])
+ xstransact.Mkdir("/local/domain/0/xenpaging/%s" % self.vm.info['name_label']) + xstransact.Mkdir("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'])
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay', '0.0')) + xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay', '7.0'))
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_inc', '0.1')) + xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_inc', '0.1'))
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_use', '5')) + xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_use', '5'))
+ xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_used', '0')) + xstransact.Store("/local/domain/0/xenpaging/%s" % self.vm.info['name_label'], ('xenpaging_delay_used', '0'))

61
xenpaging.doc.patch Normal file
View File

@ -0,0 +1,61 @@
Subject: xenpaging: (sparse) documenation
Write up some sparse documentation about xenpaging usage.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
docs/misc/xenpaging.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
--- /dev/null
+++ xen-4.0.1-testing/docs/misc/xenpaging.txt
@@ -0,0 +1,48 @@
+Warning:
+
+The xenpaging code is new and not fully debugged.
+Usage of xenpaging can crash Xen or cause severe data corruption in the
+guest memory and its filesystems!
+
+Description:
+
+xenpaging writes memory pages of a given guest to a file and moves the
+pages back to the pool of available memory. Once the guests wants to
+access the paged-out memory, the page is read from disk and placed into
+memory. This allows the sum of all running guests to use more memory
+than physically available on the host.
+
+Usage:
+
+Once the guest is running, run xenpaging with the guest_id and the
+number of pages to page-out:
+
+ chdir /var/lib/xen/xenpaging
+ xenpaging <guest_id> <number_of_pages>
+
+To obtain the guest_id, run 'xm list'.
+xenpaging will write the pagefile to the current directory.
+Example with 128MB pagefile on guest 1:
+
+ xenpaging 1 32768
+
+Caution: stopping xenpaging manually will cause the guest to stall or
+crash because the paged-out memory is not written back into the guest!
+
+After a reboot of a guest, its guest_id changes, the current xenpaging
+binary has no target anymore. To automate restarting of xenpaging after
+guest reboot, specify the number if pages in the guest configuration
+file /etc/xen/vm/<guest_name>:
+
+xenpaging=32768
+
+Redo the guest with 'xm create /etc/xen/vm/<guest_name>' to activate the
+changes.
+
+
+Todo:
+- implement stopping of xenpaging
+- implement/test live migration
+
+
+# vim: tw=72

View File

@ -5,6 +5,8 @@ If it is, request a page-in and return GNTST_eagain to the caller
to indicate a retry of the hypercall is required. to indicate a retry of the hypercall is required.
This fixes granttable errors when xenpaging is enabled in the guest. This fixes granttable errors when xenpaging is enabled in the guest.
(xen-unstable changeset: 22209:50c1cc209f8f)
Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Already-Acked-by: Patrick Colp <pjcolp@cs.ubc.ca> Already-Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>
Already-Acked-by: Keir Fraser <keir.fraser@citrix.com> Already-Acked-by: Keir Fraser <keir.fraser@citrix.com>

View File

@ -1,5 +1,9 @@
Index: xen-4.0.1-testing/tools/xenpaging/Makefile (xen-unstable changeset: 21972:d3de6f484610)
===================================================================
---
tools/xenpaging/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- xen-4.0.1-testing.orig/tools/xenpaging/Makefile --- xen-4.0.1-testing.orig/tools/xenpaging/Makefile
+++ xen-4.0.1-testing/tools/xenpaging/Makefile +++ xen-4.0.1-testing/tools/xenpaging/Makefile
@@ -27,7 +27,7 @@ IBINS = xenpaging @@ -27,7 +27,7 @@ IBINS = xenpaging

View File

@ -43,11 +43,11 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/firmware/hvmloader/util.c | 26 +++++++++++- tools/firmware/hvmloader/util.c | 26 +++++++++++-
tools/include/Makefile | 1 tools/include/Makefile | 1
tools/ioemu-qemu-xen/hw/vga.c | 5 +- tools/ioemu-qemu-xen/hw/vga.c | 5 +-
tools/libxc/xc_domain.c | 71 +++++++++++++++++++++-------------- tools/libxc/xc_domain.c | 73 ++++++++++++++++++++++-------------
xen/arch/x86/mm.c | 26 ++++++++++-- xen/arch/x86/mm.c | 26 ++++++++++--
xen/arch/x86/mm/p2m.c | 7 +++ xen/arch/x86/mm/p2m.c | 7 +++
xen/common/memory.c | 25 +++++++++++- xen/common/memory.c | 25 +++++++++++
8 files changed, 131 insertions(+), 39 deletions(-) 8 files changed, 133 insertions(+), 39 deletions(-)
--- xen-4.0.1-testing.orig/tools/firmware/hvmloader/hvmloader.c --- xen-4.0.1-testing.orig/tools/firmware/hvmloader/hvmloader.c
+++ xen-4.0.1-testing/tools/firmware/hvmloader/hvmloader.c +++ xen-4.0.1-testing/tools/firmware/hvmloader/hvmloader.c
@ -182,7 +182,7 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
} }
--- xen-4.0.1-testing.orig/tools/libxc/xc_domain.c --- xen-4.0.1-testing.orig/tools/libxc/xc_domain.c
+++ xen-4.0.1-testing/tools/libxc/xc_domain.c +++ xen-4.0.1-testing/tools/libxc/xc_domain.c
@@ -536,6 +536,44 @@ int xc_domain_get_tsc_info(int xc_handle @@ -536,6 +536,46 @@ int xc_domain_get_tsc_info(int xc_handle
return rc; return rc;
} }
@ -208,18 +208,20 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
+ +
+ if ( err > count || err < 0 || delay > 1000 * 1000) + if ( err > count || err < 0 || delay > 1000 * 1000)
+ { + {
+ fprintf(stderr, "%s: %d err %x count %lx start %lx delay %lu/%lu\n",__func__,cmd,err,count,start,delay,delay/666); + fprintf(stderr, "%s: %d err %x count %lx start %lx delay %lu/%lu\n",__func__,cmd,err,count,start,delay,delay/(1<<15));
+ err = -1; + err = -1;
+ break; + break;
+ } + }
+ +
+ if ( err ) + if ( err )
+ {
+ delay = 0; + delay = 0;
+
+ start += err; + start += err;
+ count -= err; + count -= err;
+ }
+
+ usleep(delay); + usleep(delay);
+ delay += 666; /* 1500 iterations, 12 seconds */ + delay += 1 << 15; /* 31 iterations, 15 seconds */
+ } + }
+ +
+ return err; + return err;
@ -227,7 +229,7 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
int xc_domain_memory_increase_reservation(int xc_handle, int xc_domain_memory_increase_reservation(int xc_handle,
uint32_t domid, uint32_t domid,
@@ -546,26 +584,18 @@ int xc_domain_memory_increase_reservatio @@ -546,26 +586,18 @@ int xc_domain_memory_increase_reservatio
{ {
int err; int err;
struct xen_memory_reservation reservation = { struct xen_memory_reservation reservation = {
@ -256,7 +258,7 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
} }
return err; return err;
@@ -579,14 +609,11 @@ int xc_domain_memory_decrease_reservatio @@ -579,14 +611,11 @@ int xc_domain_memory_decrease_reservatio
{ {
int err; int err;
struct xen_memory_reservation reservation = { struct xen_memory_reservation reservation = {
@ -271,7 +273,7 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
if ( extent_start == NULL ) if ( extent_start == NULL )
{ {
DPRINTF("decrease_reservation extent_start is NULL!\n"); DPRINTF("decrease_reservation extent_start is NULL!\n");
@@ -594,16 +621,12 @@ int xc_domain_memory_decrease_reservatio @@ -594,16 +623,12 @@ int xc_domain_memory_decrease_reservatio
return -1; return -1;
} }
@ -290,7 +292,7 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
} }
return err; return err;
@@ -618,23 +641,17 @@ int xc_domain_memory_populate_physmap(in @@ -618,23 +643,17 @@ int xc_domain_memory_populate_physmap(in
{ {
int err; int err;
struct xen_memory_reservation reservation = { struct xen_memory_reservation reservation = {

View File

@ -5,6 +5,7 @@ Up to now the code called the opposite function, which clears the
(xenpaging internal) reference bit, instead of setting it and marking (xenpaging internal) reference bit, instead of setting it and marking
the page as gone. the page as gone.
(xen-unstable changeset: 22064:1bd1ba6f1aa4)
Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Already-Acked-by: Patrick Colp <pjcolp@cs.ubc.ca> Already-Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>

View File

@ -3,6 +3,7 @@ Subject: xenpaging: Fix-up xenpaging tool code.
This isn't directly related to EPT checking, but does some general fix-ups This isn't directly related to EPT checking, but does some general fix-ups
to the xenpaging code (adds some extra frees, etc.) to the xenpaging code (adds some extra frees, etc.)
(xen-unstable changeset: 21890:3263d0ff9476)
Already-Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca> Already-Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Olaf Hering <olaf@aepfle.de>

View File

@ -1,4 +1,4 @@
Subject: xenpaging: fix fd leak in xenstore Subject: xenpaging/xenstore: fix fd leak in xenstore
Missing from commit 'libxl: Backported stuff from unstable' Missing from commit 'libxl: Backported stuff from unstable'
Without this change, xs_daemon_open/xs_daemon_close will leak filedescriptors. Without this change, xs_daemon_open/xs_daemon_close will leak filedescriptors.