From abf8af324bde83c09963dd8652d8758e0166a410e53627188cded07dc4d0c0db Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Wed, 14 Jan 2015 20:58:52 +0000 Subject: [PATCH] - Update to Xen 4.5.0 FCS - Include systemd presets in 13.2 and older - bnc#897352 - Enable xencommons/xendomains only during fresh install - disable restart on upgrade because the toolstack is not restartable - adjust seabios, vgabios, stubdom and hvmloader build to reduce build-compare noise xen.build-compare.mini-os.patch xen.build-compare.smbiosdate.patch xen.build-compare.ipxe.patch xen.build-compare.vgabios.patch xen.build-compare.seabios.patch xen.build-compare.man.patch - Update to Xen 4.5.0 RC4 - Remove xend specific if-up scripts Recording bridge slaves is a generic task which should be handled by generic network code - Use systemd features from upstream requires updated systemd-presets-branding package - Update to Xen 4.5.0 RC3 - Set GIT, WGET and FTP to /bin/false - Use new configure features instead of make variables OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=337 --- ...ate-acpi_skip_timer_override-do-Dom0.patch | 59 -- ...-print-address-space-for-PM1x-fields.patch | 32 - ...9d8f-xenconsole-reset-tty-on-failure.patch | 54 -- 53299d8f-xenconsole-tolerate-tty-errors.patch | 49 - ...support-further-feature-masking-MSRs.patch | 175 ---- ...workaround-for-insecure-Dom0-kernels.patch | 82 -- ...-ranges-above-4G-with-UC-MTRR-ranges.patch | 274 ------ ...e-0xfc000000-0xffffffff-should-be-UC.patch | 34 - ...86-EFI-improve-boot-time-diagnostics.patch | 61 -- ...CR4-guest-reserved-bit-determination.patch | 169 ---- ...accesses-port-0-by-any-invalid-domid.patch | 39 - ...n_details-check-config-data-length-0.patch | 43 - ...se-even-when-ACPI-says-there-is-none.patch | 166 ---- ...d-LAPIC-shortcuts-around-P2M-lookups.patch | 112 --- ...PET-use-rwlock-instead-of-simple-one.patch | 194 ---- 53f737b1-VMX-fix-DebugCtl-MSR-clearing.patch | 39 - ...-process-softirqs-in-irq-keyhandlers.patch | 119 --- 53fcebab-xen-pass-kernel-initrd-to-qemu.patch | 335 ------- ...lidate-boolean-inputs-in-hvm-and-p2m.patch | 331 ------- ...sn-fetch-NPF-also-as-read-violations.patch | 69 -- ...-gla-fault-EPT-violation-information.patch | 133 --- ...ress-Translation-Services-by-default.patch | 49 - ...rocessing-unknown-NMIs-with-watchdog.patch | 220 ----- ...translation-known-for-certain-faults.patch | 163 ---- CVE-2013-4540-qemu.patch | 52 -- README.SUSE | 17 +- bdrv_open2_flags_2.patch | 20 +- blktap-pv-cdrom.patch | 40 +- blktap.patch | 13 - block-dmmd | 8 - bridge-bonding.patch | 57 -- bridge-opensuse.patch | 32 - bridge-record-creation.patch | 30 - bridge-vlan.patch | 71 -- build-tapdisk-ioemu.patch | 47 +- cdrom-removable.patch | 399 -------- change-vnc-passwd.patch | 166 ---- disable-wget-check.patch | 433 --------- domUloader.py | 553 ------------ init.xend | 136 --- init.xendomains | 511 ----------- ioemu-blktap-zero-size.patch | 13 - ioemu-disable-emulated-ide-if-pv.patch | 22 +- ipxe.tar.bz2 | 4 +- ...s-errno-to-callers-of-xc_domain_save.patch | 647 ------------- libxen_permissive.patch | 20 - ...-for-discard-support-to-xl-disk-conf.patch | 130 --- ...-disable-disk-cache-flushes-in-qdisk.patch | 60 +- libxl.honor-more-top-level-vfb-options.patch | 77 -- ...-disable-the-non-O_DIRECT-workaround.patch | 203 ----- libxl.pvscsi.patch | 146 +-- ...t-migration-constraints-from-cmdline.patch | 207 +++-- local_attach_support_for_phy.patch | 14 +- network-nat-open-SuSEfirewall2-FORWARD.patch | 22 - pygrub-boot-legacy-sles.patch | 16 +- pygrub-netware-xnloader.patch | 8 +- qemu-support-xen-hvm-direct-kernel-boot.patch | 87 -- qemu-xen-dir-remote.tar.bz2 | 4 +- qemu-xen-traditional-dir-remote.tar.bz2 | 4 +- qemu-xen-upstream-blkif-discard.patch | 128 --- qemu-xen-upstream-megasas-buildtime.patch | 8 +- qemu-xen-upstream-qdisk-cache-unsafe.patch | 18 +- seabios-dir-remote.tar.bz2 | 4 +- set-mtu-from-bridge-for-tap-interface.patch | 10 +- stubdom.tar.bz2 | 4 +- suspend_evtchn_lock.patch | 50 +- tigervnc-long-press.patch | 8 +- tmp-initscript-modprobe.patch | 47 - tmp_build.patch | 26 +- udev-rules.patch | 8 +- vif-bridge-no-iptables.patch | 16 +- vif-bridge-tap-fix.patch | 8 +- x86-cpufreq-report.patch | 22 +- x86-dom-print.patch | 36 - x86-extra-trap-info.patch | 47 - x86-ioapic-ack-default.patch | 8 +- xen-4.4.1-testing-src.tar.bz2 | 3 - xen-4.5.0-testing-src.tar.bz2 | 3 + xen-destdir.patch | 76 +- xen-hvm-default-bridge.patch | 21 - xen-qemu-iscsi-fix.patch | 14 +- xen-updown.sh | 177 ---- xen-watchdog.service | 12 - xen-xmexample.patch | 317 ------- xen.build-compare.doc_html.patch | 31 + xen.build-compare.ipxe.patch | 40 + xen.build-compare.man.patch | 18 + xen.build-compare.mini-os.patch | 34 + xen.build-compare.seabios.patch | 22 + xen.build-compare.smbiosdate.patch | 26 + xen.build-compare.vgabios.patch | 17 + xen.build-compare.xen_compile_h.patch | 30 + xen.changes | 228 +++++ ...-xend_move_assert_to_exception_block.patch | 43 - xen.spec | 853 +++++------------- xen.stubdom.newlib.patch | 103 +++ xen2libvirt.py | 33 +- xencommons.service | 26 +- xenconsole-no-multiple-connections.patch | 10 +- xend-32on64-extra-mem.patch | 13 - xend-change_home_server.patch | 16 - xend-check_device_status.patch | 56 -- xend-checkpoint-rename.patch | 13 - xend-config-enable-dump-comment.patch | 20 - xend-config.patch | 54 -- xend-console-port-restore.patch | 40 - xend-core-dump-loc.patch | 13 - xend-cpuinfo-model-name.patch | 24 - xend-del_usb_xend_entry.patch | 22 - xend-devid-or-name.patch | 27 - xend-disable-internal-logrotate.patch | 20 - xend-domain-lock-sfex.patch | 351 ------- xend-domain-lock.patch | 406 --------- xend-domu-usb-controller.patch | 20 - xend-hv_extid_compatibility.patch | 68 -- xend-hvm-default-pae.patch | 15 - xend-hvm-firmware-passthrough.patch | 277 ------ xend-managed-pci-device.patch | 336 ------- xend-max-free-mem.patch | 148 --- xend-migration-bridge-check.patch | 29 - xend-migration-domname-fix.patch | 35 - xend-minimum-restart-time.patch | 15 - xend-multi-xvdp.patch | 78 -- ...si-recognize-also-SCSI-CDROM-devices.patch | 27 - xend-relocation-server.fw | 4 - xend-relocation.sh | 159 ---- xend-remove-xm-deprecation-warning.patch | 34 - ...t-migration-constraints-from-cmdline.patch | 366 -------- xend-tools-watchdog-support.patch | 140 --- xend-vcpu-affinity-fix.patch | 16 - xend-vif-route-ifup.patch | 89 -- xend-xen-api-auth.patch | 13 - xend-xen-domUloader.patch | 117 --- xend-xenapi-console-protocol.patch | 19 - xend-xenpaging.autostart.patch | 413 --------- xend-xm-create-xflag.patch | 46 - xend-xm-reboot-fix.patch | 25 - xend-xm-save-check-file.patch | 97 -- xend.service | 14 - xendomains.service | 14 - xenpaging.qemu.flush-cache.patch | 8 +- xl-check-for-libvirt-managed-domain.patch | 56 -- xl-coredump-file-location.patch | 21 + xmclone.sh | 795 ---------------- xmexample.disks | 32 - xmexample.domUloader | 28 - xsa104.patch | 48 - xsa105.patch | 35 - xsa106.patch | 22 - xsa107.patch | 165 ---- xsa108.patch | 30 - 151 files changed, 1293 insertions(+), 13491 deletions(-) delete mode 100644 5315a3bb-x86-don-t-propagate-acpi_skip_timer_override-do-Dom0.patch delete mode 100644 5315a43a-x86-ACPI-also-print-address-space-for-PM1x-fields.patch delete mode 100644 53299d8f-xenconsole-reset-tty-on-failure.patch delete mode 100644 53299d8f-xenconsole-tolerate-tty-errors.patch delete mode 100644 5346a7a0-x86-AMD-support-further-feature-masking-MSRs.patch delete mode 100644 53563ea4-x86-MSI-drop-workaround-for-insecure-Dom0-kernels.patch delete mode 100644 537cd0b0-hvmloader-also-cover-PCI-MMIO-ranges-above-4G-with-UC-MTRR-ranges.patch delete mode 100644 537cd0cc-hvmloader-PA-range-0xfc000000-0xffffffff-should-be-UC.patch delete mode 100644 539ebe62-x86-EFI-improve-boot-time-diagnostics.patch delete mode 100644 53aac342-x86-HVM-consolidate-and-sanitize-CR4-guest-reserved-bit-determination.patch delete mode 100644 53c9151b-Fix-xl-vncviewer-accesses-port-0-by-any-invalid-domid.patch delete mode 100644 53d124e7-fix-list_domain_details-check-config-data-length-0.patch delete mode 100644 53dba447-x86-ACPI-allow-CMOS-RTC-use-even-when-ACPI-says-there-is-none.patch delete mode 100644 53df727b-x86-HVM-extend-LAPIC-shortcuts-around-P2M-lookups.patch delete mode 100644 53e8be5f-x86-vHPET-use-rwlock-instead-of-simple-one.patch delete mode 100644 53f737b1-VMX-fix-DebugCtl-MSR-clearing.patch delete mode 100644 53f7386d-x86-irq-process-softirqs-in-irq-keyhandlers.patch delete mode 100644 53fcebab-xen-pass-kernel-initrd-to-qemu.patch delete mode 100644 53ff3659-x86-consolidate-boolean-inputs-in-hvm-and-p2m.patch delete mode 100644 53ff36ae-x86-hvm-treat-non-insn-fetch-NPF-also-as-read-violations.patch delete mode 100644 53ff36d5-x86-mem_event-deliver-gla-fault-EPT-violation-information.patch delete mode 100644 53ff3716-x86-ats-Disable-Address-Translation-Services-by-default.patch delete mode 100644 53ff3899-x86-NMI-allow-processing-unknown-NMIs-with-watchdog.patch delete mode 100644 54005472-EPT-utilize-GLA-GPA-translation-known-for-certain-faults.patch delete mode 100644 CVE-2013-4540-qemu.patch delete mode 100644 bridge-bonding.patch delete mode 100644 bridge-opensuse.patch delete mode 100644 bridge-record-creation.patch delete mode 100644 bridge-vlan.patch delete mode 100644 change-vnc-passwd.patch delete mode 100644 disable-wget-check.patch delete mode 100644 domUloader.py delete mode 100644 init.xend delete mode 100644 init.xendomains delete mode 100644 libxc-pass-errno-to-callers-of-xc_domain_save.patch delete mode 100644 libxen_permissive.patch delete mode 100644 libxl.add-option-for-discard-support-to-xl-disk-conf.patch delete mode 100644 libxl.honor-more-top-level-vfb-options.patch delete mode 100644 libxl.introduce-an-option-to-disable-the-non-O_DIRECT-workaround.patch delete mode 100644 network-nat-open-SuSEfirewall2-FORWARD.patch delete mode 100644 qemu-support-xen-hvm-direct-kernel-boot.patch delete mode 100644 qemu-xen-upstream-blkif-discard.patch delete mode 100644 tmp-initscript-modprobe.patch delete mode 100644 x86-dom-print.patch delete mode 100644 x86-extra-trap-info.patch delete mode 100644 xen-4.4.1-testing-src.tar.bz2 create mode 100644 xen-4.5.0-testing-src.tar.bz2 delete mode 100644 xen-updown.sh delete mode 100644 xen-watchdog.service delete mode 100644 xen-xmexample.patch create mode 100644 xen.build-compare.doc_html.patch create mode 100644 xen.build-compare.ipxe.patch create mode 100644 xen.build-compare.man.patch create mode 100644 xen.build-compare.mini-os.patch create mode 100644 xen.build-compare.seabios.patch create mode 100644 xen.build-compare.smbiosdate.patch create mode 100644 xen.build-compare.vgabios.patch create mode 100644 xen.build-compare.xen_compile_h.patch delete mode 100644 xen.migrate.tools-xend_move_assert_to_exception_block.patch create mode 100644 xen.stubdom.newlib.patch delete mode 100644 xend-32on64-extra-mem.patch delete mode 100644 xend-change_home_server.patch delete mode 100644 xend-check_device_status.patch delete mode 100644 xend-checkpoint-rename.patch delete mode 100644 xend-config-enable-dump-comment.patch delete mode 100644 xend-config.patch delete mode 100644 xend-console-port-restore.patch delete mode 100644 xend-core-dump-loc.patch delete mode 100644 xend-cpuinfo-model-name.patch delete mode 100644 xend-del_usb_xend_entry.patch delete mode 100644 xend-devid-or-name.patch delete mode 100644 xend-disable-internal-logrotate.patch delete mode 100644 xend-domain-lock-sfex.patch delete mode 100644 xend-domain-lock.patch delete mode 100644 xend-domu-usb-controller.patch delete mode 100644 xend-hv_extid_compatibility.patch delete mode 100644 xend-hvm-default-pae.patch delete mode 100644 xend-hvm-firmware-passthrough.patch delete mode 100644 xend-managed-pci-device.patch delete mode 100644 xend-max-free-mem.patch delete mode 100644 xend-migration-bridge-check.patch delete mode 100644 xend-migration-domname-fix.patch delete mode 100644 xend-minimum-restart-time.patch delete mode 100644 xend-multi-xvdp.patch delete mode 100644 xend-pvscsi-recognize-also-SCSI-CDROM-devices.patch delete mode 100644 xend-relocation-server.fw delete mode 100644 xend-relocation.sh delete mode 100644 xend-remove-xm-deprecation-warning.patch delete mode 100644 xend-set-migration-constraints-from-cmdline.patch delete mode 100644 xend-tools-watchdog-support.patch delete mode 100644 xend-vcpu-affinity-fix.patch delete mode 100644 xend-vif-route-ifup.patch delete mode 100644 xend-xen-api-auth.patch delete mode 100644 xend-xen-domUloader.patch delete mode 100644 xend-xenapi-console-protocol.patch delete mode 100644 xend-xenpaging.autostart.patch delete mode 100644 xend-xm-create-xflag.patch delete mode 100644 xend-xm-reboot-fix.patch delete mode 100644 xend-xm-save-check-file.patch delete mode 100644 xend.service delete mode 100644 xendomains.service delete mode 100644 xl-check-for-libvirt-managed-domain.patch create mode 100644 xl-coredump-file-location.patch delete mode 100644 xmclone.sh delete mode 100644 xmexample.disks delete mode 100644 xmexample.domUloader delete mode 100644 xsa104.patch delete mode 100644 xsa105.patch delete mode 100644 xsa106.patch delete mode 100644 xsa107.patch delete mode 100644 xsa108.patch diff --git a/5315a3bb-x86-don-t-propagate-acpi_skip_timer_override-do-Dom0.patch b/5315a3bb-x86-don-t-propagate-acpi_skip_timer_override-do-Dom0.patch deleted file mode 100644 index 02c73f9..0000000 --- a/5315a3bb-x86-don-t-propagate-acpi_skip_timer_override-do-Dom0.patch +++ /dev/null @@ -1,59 +0,0 @@ -# Commit 8db22866dbbcabf30ad6e3814489c730b53d1cf4 -# Date 2014-03-04 10:58:19 +0100 -# Author Jan Beulich -# Committer Jan Beulich -x86: don't propagate acpi_skip_timer_override do Dom0 - -It's unclear why c/s 4850:923dd9975981 added this - Dom0 isn't -controlling the timer interrupt, and hence has no need to know. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser -Reviewed-by: Andrew Cooper - ---- a/xen/arch/x86/acpi/boot.c -+++ b/xen/arch/x86/acpi/boot.c -@@ -56,7 +56,9 @@ bool_t __initdata acpi_ht = 1; /* enable - bool_t __initdata acpi_lapic; - bool_t __initdata acpi_ioapic; - --bool_t acpi_skip_timer_override __initdata; -+/* acpi_skip_timer_override: Skip IRQ0 overrides. */ -+static bool_t acpi_skip_timer_override __initdata; -+boolean_param("acpi_skip_timer_override", acpi_skip_timer_override); - - #ifdef CONFIG_X86_LOCAL_APIC - static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; ---- a/xen/arch/x86/setup.c -+++ b/xen/arch/x86/setup.c -@@ -71,10 +71,6 @@ static void parse_acpi_param(char *s); - custom_param("acpi", parse_acpi_param); - - /* **** Linux config option: propagated to domain0. */ --/* acpi_skip_timer_override: Skip IRQ0 overrides. */ --boolean_param("acpi_skip_timer_override", acpi_skip_timer_override); -- --/* **** Linux config option: propagated to domain0. */ - /* noapic: Disable IOAPIC setup. */ - boolean_param("noapic", skip_ioapic_setup); - -@@ -1365,9 +1361,6 @@ void __init __start_xen(unsigned long mb - /* Append any extra parameters. */ - if ( skip_ioapic_setup && !strstr(dom0_cmdline, "noapic") ) - safe_strcat(dom0_cmdline, " noapic"); -- if ( acpi_skip_timer_override && -- !strstr(dom0_cmdline, "acpi_skip_timer_override") ) -- safe_strcat(dom0_cmdline, " acpi_skip_timer_override"); - if ( (strlen(acpi_param) == 0) && acpi_disabled ) - { - printk("ACPI is disabled, notifying Domain 0 (acpi=off)\n"); ---- a/xen/include/asm-x86/acpi.h -+++ b/xen/include/asm-x86/acpi.h -@@ -80,7 +80,6 @@ int __acpi_release_global_lock(unsigned - - extern bool_t acpi_lapic, acpi_ioapic, acpi_noirq; - extern bool_t acpi_force, acpi_ht, acpi_disabled; --extern bool_t acpi_skip_timer_override; - extern u32 acpi_smi_cmd; - extern u8 acpi_enable_value, acpi_disable_value; - void acpi_pic_sci_set_trigger(unsigned int, u16); diff --git a/5315a43a-x86-ACPI-also-print-address-space-for-PM1x-fields.patch b/5315a43a-x86-ACPI-also-print-address-space-for-PM1x-fields.patch deleted file mode 100644 index b6b0b7b..0000000 --- a/5315a43a-x86-ACPI-also-print-address-space-for-PM1x-fields.patch +++ /dev/null @@ -1,32 +0,0 @@ -# Commit 7acf827b951b4e8501a777676ddf050d200103a4 -# Date 2014-03-04 11:00:26 +0100 -# Author Jan Beulich -# Committer Jan Beulich -x86/ACPI: also print address space for PM1x fields - -At least one vendor is in the process of making systems available where -these live in MMIO, not in I/O port space. - -Signed-off-by: Jan Beulich -Acked-by: Keir Fraser - ---- a/xen/arch/x86/acpi/boot.c -+++ b/xen/arch/x86/acpi/boot.c -@@ -404,11 +404,15 @@ acpi_fadt_parse_sleep_info(struct acpi_t - acpi_fadt_copy_address(pm1b_evt, pm1b_event, pm1_event); - - printk(KERN_INFO PREFIX -- "SLEEP INFO: pm1x_cnt[%"PRIx64",%"PRIx64"], " -- "pm1x_evt[%"PRIx64",%"PRIx64"]\n", -+ "SLEEP INFO: pm1x_cnt[%d:%"PRIx64",%d:%"PRIx64"], " -+ "pm1x_evt[%d:%"PRIx64",%d:%"PRIx64"]\n", -+ acpi_sinfo.pm1a_cnt_blk.space_id, - acpi_sinfo.pm1a_cnt_blk.address, -+ acpi_sinfo.pm1b_cnt_blk.space_id, - acpi_sinfo.pm1b_cnt_blk.address, -+ acpi_sinfo.pm1a_evt_blk.space_id, - acpi_sinfo.pm1a_evt_blk.address, -+ acpi_sinfo.pm1b_evt_blk.space_id, - acpi_sinfo.pm1b_evt_blk.address); - - /* Now FACS... */ diff --git a/53299d8f-xenconsole-reset-tty-on-failure.patch b/53299d8f-xenconsole-reset-tty-on-failure.patch deleted file mode 100644 index be70997..0000000 --- a/53299d8f-xenconsole-reset-tty-on-failure.patch +++ /dev/null @@ -1,54 +0,0 @@ -Subject: tools/console: reset tty when xenconsole fails -From: Ian Jackson ian.jackson@eu.citrix.com Mon Feb 24 15:16:19 2014 +0000 -Date: Wed Mar 19 13:37:19 2014 +0000: -Git: 111931f36885874103d65685ab15ea3d25d93da7 - -If xenconsole (the client program) fails, it calls err. This would -previously neglect to reset the user's terminal to sanity. Use atexit -to do so. - -This routinely happens in Xen 4.4 RC5 with pygrub because libxl -writes the value "" to the tty xenstore key when using xenconsole. -After this patch this just results in a harmless error message. - -Reported-by: M A Young -Signed-off-by: Ian Jackson -CC: M A Young -CC: Ian Campbell -Acked-by: George Dunlap -Acked-by: Ian Campbell - ---- -v2: Fix whitespace error (reintroduce hard tab) - Fix commit message not to claim ignorance about root cause - -Index: xen-4.4.0-testing/tools/console/client/main.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/console/client/main.c -+++ xen-4.4.0-testing/tools/console/client/main.c -@@ -258,6 +258,13 @@ typedef enum { - CONSOLE_SERIAL, - } console_type; - -+static struct termios stdin_old_attr; -+ -+static void restore_term_stdin(void) -+{ -+ restore_term(STDIN_FILENO, &stdin_old_attr); -+} -+ - int main(int argc, char **argv) - { - struct termios attr; -@@ -384,9 +391,9 @@ int main(int argc, char **argv) - } - - init_term(spty, &attr); -- init_term(STDIN_FILENO, &attr); -+ init_term(STDIN_FILENO, &stdin_old_attr); -+ atexit(restore_term_stdin); /* if this fails, oh dear */ - console_loop(spty, xs, path); -- restore_term(STDIN_FILENO, &attr); - - free(path); - free(dom_path); diff --git a/53299d8f-xenconsole-tolerate-tty-errors.patch b/53299d8f-xenconsole-tolerate-tty-errors.patch deleted file mode 100644 index 0406c8c..0000000 --- a/53299d8f-xenconsole-tolerate-tty-errors.patch +++ /dev/null @@ -1,49 +0,0 @@ -Subject: tools/console: xenconsole tolerate tty errors -From: Ian Jackson ian.jackson@eu.citrix.com Thu Feb 27 17:46:49 2014 +0000 -Date: Wed Mar 19 13:37:19 2014 +0000: -Git: 39ba2989b10b6a1852e253b204eb010f8e7026f1 - -Since 28d386fc4341 (XSA-57), libxl writes an empty value for the -console tty node, with read-only permission for the guest, when -setting up pv console "frontends". (The actual tty value is later set -by xenconsoled.) Writing an empty node is not strictly necessary to -stop the frontend from writing dangerous values here, but it is a good -belt-and-braces approach. - -Unfortunately this confuses xenconsole. It reads the empty value, and -tries to open it as the tty. xenconsole then exits. - -Fix this by having xenconsole treat an empty value the same way as no -value at all. - -Also, make the error opening the tty be nonfatal: we just print a -warning, but do not exit. I think this is helpful in theoretical -situations where xenconsole is racing with libxl and/or xenconsoled. - -Signed-off-by: Ian Jackson -Acked-by: Ian Campbell -CC: George Dunlap - ---- -v2: Combine two conditions and move the free - -Index: xen-4.4.0-testing/tools/console/client/main.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/console/client/main.c -+++ xen-4.4.0-testing/tools/console/client/main.c -@@ -115,12 +115,12 @@ static int get_pty_fd(struct xs_handle * - /* We only watch for one thing, so no need to - * disambiguate: just read the pty path */ - pty_path = xs_read(xs, XBT_NULL, path, &len); -- if (pty_path != NULL) { -+ if (pty_path != NULL && pty_path[0] != '\0') { - pty_fd = open(pty_path, O_RDWR | O_NOCTTY); - if (pty_fd == -1) -- err(errno, "Could not open tty `%s'", pty_path); -- free(pty_path); -+ warn("Could not open tty `%s'", pty_path); - } -+ free(pty_path); - } - } while (pty_fd == -1 && (now = time(NULL)) < start + seconds); - diff --git a/5346a7a0-x86-AMD-support-further-feature-masking-MSRs.patch b/5346a7a0-x86-AMD-support-further-feature-masking-MSRs.patch deleted file mode 100644 index 9b91a35..0000000 --- a/5346a7a0-x86-AMD-support-further-feature-masking-MSRs.patch +++ /dev/null @@ -1,175 +0,0 @@ -# Commit e74de9c0b19f9bd16d658a96bf6c9ab9a2a639e9 -# Date 2014-04-10 16:16:00 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/AMD: support further feature masking MSRs - -Newer AMD CPUs also allow masking CPUID leaf 6 ECX and CPUID leaf 7 -sub-leaf 0 EAX and EBX. - -Signed-off-by: Jan Beulich -Reviewed-by: Aravind Gopalakrishnan - ---- a/docs/misc/xen-command-line.markdown -+++ b/docs/misc/xen-command-line.markdown -@@ -320,24 +320,42 @@ Indicate where the responsibility for dr - ### cpuid\_mask\_cpu (AMD only) - > `= fam_0f_rev_c | fam_0f_rev_d | fam_0f_rev_e | fam_0f_rev_f | fam_0f_rev_g | fam_10_rev_b | fam_10_rev_c | fam_11_rev_b` - --If the other **cpuid\_mask\_{,ext\_}e{c,d}x** options are fully set --(unspecified on the command line), specify a pre-canned cpuid mask to --mask the current processor down to appear as the specified processor. --It is important to ensure that all hosts in a pool appear the same to --guests to allow successful live migration. -+If the other **cpuid\_mask\_{,ext\_,thermal\_,l7s0\_}e{a,b,c,d}x** -+options are fully set (unspecified on the command line), specify a -+pre-canned cpuid mask to mask the current processor down to appear as -+the specified processor. It is important to ensure that all hosts in a -+pool appear the same to guests to allow successful live migration. - --### cpuid\_mask\_ ecx,edx,ext\_ecx,ext\_edx,xsave_eax -+### cpuid\_mask\_{{,ext\_}ecx,edx} - > `= ` - - > Default: `~0` (all bits set) - --These five command line parameters are used to specify cpuid masks to -+These four command line parameters are used to specify cpuid masks to - help with cpuid levelling across a pool of hosts. Setting a bit in - the mask indicates that the feature should be enabled, while clearing - a bit in the mask indicates that the feature should be disabled. It - is important to ensure that all hosts in a pool appear the same to - guests to allow successful live migration. - -+### cpuid\_mask\_xsave\_eax (Intel only) -+> `= ` -+ -+> Default: `~0` (all bits set) -+ -+This command line parameter is also used to specify a cpuid mask to -+help with cpuid levelling across a pool of hosts. See the description -+of the other respective options above. -+ -+### cpuid\_mask\_{l7s0\_{eax,ebx},thermal\_ecx} (AMD only) -+> `= ` -+ -+> Default: `~0` (all bits set) -+ -+These three command line parameters are also used to specify cpuid -+masks to help with cpuid levelling across a pool of hosts. See the -+description of the other respective options above. -+ - ### cpuidle - > `= ` - ---- a/xen/arch/x86/cpu/amd.c -+++ b/xen/arch/x86/cpu/amd.c -@@ -30,9 +30,17 @@ - * "fam_10_rev_c" - * "fam_11_rev_b" - */ --static char opt_famrev[14]; -+static char __initdata opt_famrev[14]; - string_param("cpuid_mask_cpu", opt_famrev); - -+static unsigned int __initdata opt_cpuid_mask_l7s0_eax = ~0u; -+integer_param("cpuid_mask_l7s0_eax", opt_cpuid_mask_l7s0_eax); -+static unsigned int __initdata opt_cpuid_mask_l7s0_ebx = ~0u; -+integer_param("cpuid_mask_l7s0_ebx", opt_cpuid_mask_l7s0_ebx); -+ -+static unsigned int __initdata opt_cpuid_mask_thermal_ecx = ~0u; -+integer_param("cpuid_mask_thermal_ecx", opt_cpuid_mask_thermal_ecx); -+ - /* 1 = allow, 0 = don't allow guest creation, -1 = don't allow boot */ - s8 __read_mostly opt_allow_unsafe; - boolean_param("allow_unsafe", opt_allow_unsafe); -@@ -96,7 +104,11 @@ static void __devinit set_cpuidmask(cons - { - static unsigned int feat_ecx, feat_edx; - static unsigned int extfeat_ecx, extfeat_edx; -+ static unsigned int l7s0_eax, l7s0_ebx; -+ static unsigned int thermal_ecx; -+ static bool_t skip_l7s0_eax_ebx, skip_thermal_ecx; - static enum { not_parsed, no_mask, set_mask } status; -+ unsigned int eax, ebx, ecx, edx; - - if (status == no_mask) - return; -@@ -104,7 +116,7 @@ static void __devinit set_cpuidmask(cons - if (status == set_mask) - goto setmask; - -- ASSERT((status == not_parsed) && (smp_processor_id() == 0)); -+ ASSERT((status == not_parsed) && (c == &boot_cpu_data)); - status = no_mask; - - /* Fam11 doesn't support masking at all. */ -@@ -112,11 +124,16 @@ static void __devinit set_cpuidmask(cons - return; - - if (~(opt_cpuid_mask_ecx & opt_cpuid_mask_edx & -- opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx)) { -+ opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx & -+ opt_cpuid_mask_l7s0_eax & opt_cpuid_mask_l7s0_ebx & -+ opt_cpuid_mask_thermal_ecx)) { - feat_ecx = opt_cpuid_mask_ecx; - feat_edx = opt_cpuid_mask_edx; - extfeat_ecx = opt_cpuid_mask_ext_ecx; - extfeat_edx = opt_cpuid_mask_ext_edx; -+ l7s0_eax = opt_cpuid_mask_l7s0_eax; -+ l7s0_ebx = opt_cpuid_mask_l7s0_ebx; -+ thermal_ecx = opt_cpuid_mask_thermal_ecx; - } else if (*opt_famrev == '\0') { - return; - } else if (!strcmp(opt_famrev, "fam_0f_rev_c")) { -@@ -179,11 +196,39 @@ static void __devinit set_cpuidmask(cons - printk("Writing CPUID extended feature mask ECX:EDX -> %08Xh:%08Xh\n", - extfeat_ecx, extfeat_edx); - -+ if (c->cpuid_level >= 7) -+ cpuid_count(7, 0, &eax, &ebx, &ecx, &edx); -+ else -+ ebx = eax = 0; -+ if ((eax | ebx) && ~(l7s0_eax & l7s0_ebx)) { -+ if (l7s0_eax > eax) -+ l7s0_eax = eax; -+ l7s0_ebx &= ebx; -+ printk("Writing CPUID leaf 7 subleaf 0 feature mask EAX:EBX -> %08Xh:%08Xh\n", -+ l7s0_eax, l7s0_ebx); -+ } else -+ skip_l7s0_eax_ebx = 1; -+ -+ /* Only Fam15 has the respective MSR. */ -+ ecx = c->x86 == 0x15 && c->cpuid_level >= 6 ? cpuid_ecx(6) : 0; -+ if (ecx && ~thermal_ecx) { -+ thermal_ecx &= ecx; -+ printk("Writing CPUID thermal/power feature mask ECX -> %08Xh\n", -+ thermal_ecx); -+ } else -+ skip_thermal_ecx = 1; -+ - setmask: - /* AMD processors prior to family 10h required a 32-bit password */ - if (c->x86 >= 0x10) { - wrmsr(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx); - wrmsr(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx); -+ if (!skip_l7s0_eax_ebx) -+ wrmsr(MSR_AMD_L7S0_FEATURE_MASK, l7s0_ebx, l7s0_eax); -+ if (!skip_thermal_ecx) { -+ rdmsr(MSR_AMD_THRM_FEATURE_MASK, eax, edx); -+ wrmsr(MSR_AMD_THRM_FEATURE_MASK, thermal_ecx, edx); -+ } - } else { - wrmsr_amd(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx); - wrmsr_amd(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx); ---- a/xen/include/asm-x86/msr-index.h -+++ b/xen/include/asm-x86/msr-index.h -@@ -204,6 +204,8 @@ - #define MSR_AMD_FAM15H_EVNTSEL5 0xc001020a - #define MSR_AMD_FAM15H_PERFCTR5 0xc001020b - -+#define MSR_AMD_L7S0_FEATURE_MASK 0xc0011002 -+#define MSR_AMD_THRM_FEATURE_MASK 0xc0011003 - #define MSR_K8_FEATURE_MASK 0xc0011004 - #define MSR_K8_EXT_FEATURE_MASK 0xc0011005 - diff --git a/53563ea4-x86-MSI-drop-workaround-for-insecure-Dom0-kernels.patch b/53563ea4-x86-MSI-drop-workaround-for-insecure-Dom0-kernels.patch deleted file mode 100644 index 684ed92..0000000 --- a/53563ea4-x86-MSI-drop-workaround-for-insecure-Dom0-kernels.patch +++ /dev/null @@ -1,82 +0,0 @@ -# Commit 061eebe0e99ad45c9c3b1a778b06140de4a91f25 -# Date 2014-04-22 12:04:20 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/MSI: drop workaround for insecure Dom0 kernels - -Considering that -- the workaround is expensive (iterating through the entire P2M space - of a domain), -- the planned elimination of the expensiveness (by propagating the type - change step by step to the individual P2M leaves) wouldn't address - the IOMMU side of things (as for it to obey to the changed - permissions the adjustments must be pushed down immediately through - the entire tree) -- the proper solution (PHYSDEVOP_msix_prepare) should by now be - implemented by all security conscious Dom0 kernels -remove the workaround, killing eventual guests that would be known to -become a security risk instead. - -Signed-off-by: Jan Beulich -Acked-by: Kevin Tian - ---- a/xen/arch/x86/mm/p2m-ept.c -+++ b/xen/arch/x86/mm/p2m-ept.c -@@ -679,7 +679,7 @@ static void ept_change_entry_type_global - return; - - BUG_ON(p2m_is_grant(ot) || p2m_is_grant(nt)); -- BUG_ON(ot != nt && (ot == p2m_mmio_direct || nt == p2m_mmio_direct)); -+ BUG_ON(p2m_is_mmio(ot) || p2m_is_mmio(nt)); - - ept_change_entry_type_page(_mfn(ept_get_asr(ept)), - ept_get_wl(ept), ot, nt); ---- a/xen/arch/x86/msi.c -+++ b/xen/arch/x86/msi.c -@@ -825,32 +825,22 @@ static int msix_capability_init(struct p - msix->pba.last) ) - WARN(); - -- if ( dev->domain ) -- p2m_change_entry_type_global(dev->domain, -- p2m_mmio_direct, p2m_mmio_direct); -- if ( desc && (!dev->domain || !paging_mode_translate(dev->domain)) ) -+ if ( desc ) - { -- struct domain *d = dev->domain; -+ struct domain *currd = current->domain; -+ struct domain *d = dev->domain ?: currd; - -- if ( !d ) -- for_each_domain(d) -- if ( !paging_mode_translate(d) && -- (iomem_access_permitted(d, msix->table.first, -- msix->table.last) || -- iomem_access_permitted(d, msix->pba.first, -- msix->pba.last)) ) -- break; -- if ( d ) -- { -- if ( !is_hardware_domain(d) && msix->warned != d->domain_id ) -- { -- msix->warned = d->domain_id; -- printk(XENLOG_ERR -- "Potentially insecure use of MSI-X on %04x:%02x:%02x.%u by Dom%d\n", -- seg, bus, slot, func, d->domain_id); -- } -- /* XXX How to deal with existing mappings? */ -- } -+ if ( !is_hardware_domain(currd) || d != currd ) -+ printk("%s use of MSI-X on %04x:%02x:%02x.%u by Dom%d\n", -+ is_hardware_domain(currd) -+ ? XENLOG_WARNING "Potentially insecure" -+ : XENLOG_ERR "Insecure", -+ seg, bus, slot, func, d->domain_id); -+ if ( !is_hardware_domain(d) && -+ /* Assume a domain without memory has no mappings yet. */ -+ (!is_hardware_domain(currd) || d->tot_pages) ) -+ domain_crash(d); -+ /* XXX How to deal with existing mappings? */ - } - } - WARN_ON(msix->nr_entries != nr_entries); diff --git a/537cd0b0-hvmloader-also-cover-PCI-MMIO-ranges-above-4G-with-UC-MTRR-ranges.patch b/537cd0b0-hvmloader-also-cover-PCI-MMIO-ranges-above-4G-with-UC-MTRR-ranges.patch deleted file mode 100644 index 8d62ae9..0000000 --- a/537cd0b0-hvmloader-also-cover-PCI-MMIO-ranges-above-4G-with-UC-MTRR-ranges.patch +++ /dev/null @@ -1,274 +0,0 @@ -# Commit d06886694328a31369addc1f614cf326728d65a6 -# Date 2014-05-21 18:13:36 +0200 -# Author Jan Beulich -# Committer Jan Beulich -hvmloader: also cover PCI MMIO ranges above 4G with UC MTRR ranges - -When adding support for BAR assignments to addresses above 4G, the MTRR -side of things was left out. - -Additionally the MMIO ranges in the DSDT's \_SB.PCI0._CRS were having -memory types not matching the ones put into MTRRs: The legacy VGA range -is supposed to be WC, and the other ones should be UC. - -Signed-off-by: Jan Beulich -Acked-by: Ian Campbell - -# Commit 119d8a42d3bfe6ebc1785720e1a7260e5c698632 -# Date 2014-05-22 14:20:19 +0200 -# Author Jan Beulich -# Committer Jan Beulich -hvmloader: fix build with certain iasl versions - -While most of them support what we have now, Wheezy's dislikes the -empty range. Put a fake one in place - it's getting overwritten upon -evaluation of _CRS anyway. - -The range could be grown (downwards) if necessary; the way it is now -it is -- the highest possible one below the 36-bit boundary (with 36 bits - being the lowest common denominator for all supported systems), -- the smallest possible one that said iasl accepts. - -Reported-by: Sander Eikelenboom -Signed-off-by: Jan Beulich -Acked-by: Ian Campbell - -# Commit 7f8d8abcf6dfb85fae591a547b24f9b27d92272c -# Date 2014-05-28 10:57:18 +0200 -# Author Jan Beulich -# Committer Jan Beulich -hvmloader: don't use AML operations on 64-bit fields - -WinXP and Win2K3, while having no problem with the QWordMemory resource -(there was another one there before), don't like operations on 64-bit -fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO -ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling -carry over explicitly. - -Sadly the constructs needed to create the sub-fields - nominally - - CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL) - CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH) - -- can't be used: The former gets warned upon by newer iasl, i.e. would -need to be replaced by the latter just with the addend changed to 0, -and the latter doesn't translate properly with recent iasl). Hence, -short of having an ASL/iasl expert at hand, we need to work around the -shortcomings of various iasl versions. See the code comment. - -Signed-off-by: Jan Beulich -Acked-by: Ian Campbell - ---- a/tools/firmware/hvmloader/acpi/build.c -+++ b/tools/firmware/hvmloader/acpi/build.c -@@ -51,6 +51,7 @@ struct acpi_info { - uint32_t madt_csum_addr; /* 12 - Address of MADT checksum */ - uint32_t madt_lapic0_addr; /* 16 - Address of first MADT LAPIC struct */ - uint32_t vm_gid_addr; /* 20 - Address of VM generation id buffer */ -+ uint64_t pci_hi_min, pci_hi_len; /* 24, 32 - PCI I/O hole boundaries */ - }; - - /* Number of processor objects in the chosen DSDT. */ -@@ -525,6 +526,11 @@ void acpi_build_tables(struct acpi_confi - acpi_info->hpet_present = hpet_exists(ACPI_HPET_ADDRESS); - acpi_info->pci_min = pci_mem_start; - acpi_info->pci_len = pci_mem_end - pci_mem_start; -+ if ( pci_hi_mem_end > pci_hi_mem_start ) -+ { -+ acpi_info->pci_hi_min = pci_hi_mem_start; -+ acpi_info->pci_hi_len = pci_hi_mem_end - pci_hi_mem_start; -+ } - - return; - ---- a/tools/firmware/hvmloader/acpi/dsdt.asl -+++ b/tools/firmware/hvmloader/acpi/dsdt.asl -@@ -45,7 +45,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, - Scope (\_SB) - { - /* ACPI_INFO_PHYSICAL_ADDRESS == 0xFC000000 */ -- OperationRegion(BIOS, SystemMemory, 0xFC000000, 24) -+ OperationRegion(BIOS, SystemMemory, 0xFC000000, 40) - Field(BIOS, ByteAcc, NoLock, Preserve) { - UAR1, 1, - UAR2, 1, -@@ -56,7 +56,11 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, - PLEN, 32, - MSUA, 32, /* MADT checksum address */ - MAPA, 32, /* MADT LAPIC0 address */ -- VGIA, 32 /* VM generation id address */ -+ VGIA, 32, /* VM generation id address */ -+ LMIN, 32, -+ HMIN, 32, -+ LLEN, 32, -+ HLEN, 32 - } - - /* Fix HCT test for 0x400 pci memory: -@@ -136,7 +140,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, - /* reserve memory for pci devices */ - DWordMemory( - ResourceProducer, PosDecode, MinFixed, MaxFixed, -- Cacheable, ReadWrite, -+ WriteCombining, ReadWrite, - 0x00000000, - 0x000A0000, - 0x000BFFFF, -@@ -145,13 +149,24 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, - - DWordMemory( - ResourceProducer, PosDecode, MinFixed, MaxFixed, -- Cacheable, ReadWrite, -+ NonCacheable, ReadWrite, - 0x00000000, - 0xF0000000, - 0xF4FFFFFF, - 0x00000000, - 0x05000000, - ,, _Y01) -+ -+ QWordMemory ( -+ ResourceProducer, PosDecode, MinFixed, MaxFixed, -+ NonCacheable, ReadWrite, -+ 0x0000000000000000, -+ 0x0000000FFFFFFFF0, -+ 0x0000000FFFFFFFFF, -+ 0x0000000000000000, -+ 0x0000000000000010, -+ ,, _Y02) -+ - }) - - CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN) -@@ -163,6 +178,43 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, - Add(MMIN, MLEN, MMAX) - Subtract(MMAX, One, MMAX) - -+ /* -+ * WinXP / Win2K3 blue-screen for operations on 64-bit values. -+ * Therefore we need to split the 64-bit calculations needed -+ * here, but different iasl versions evaluate name references -+ * to integers differently: -+ * Year (approximate) 2006 2008 2012 -+ * \_SB.PCI0._CRS._Y02 zero valid valid -+ * \_SB.PCI0._CRS._Y02._MIN valid valid huge -+ */ -+ If(LEqual(Zero, \_SB.PCI0._CRS._Y02)) { -+ Subtract(\_SB.PCI0._CRS._Y02._MIN, 14, Local0) -+ } Else { -+ Store(\_SB.PCI0._CRS._Y02, Local0) -+ } -+ CreateDWordField(PRT0, Add(Local0, 14), MINL) -+ CreateDWordField(PRT0, Add(Local0, 18), MINH) -+ CreateDWordField(PRT0, Add(Local0, 22), MAXL) -+ CreateDWordField(PRT0, Add(Local0, 26), MAXH) -+ CreateDWordField(PRT0, Add(Local0, 38), LENL) -+ CreateDWordField(PRT0, Add(Local0, 42), LENH) -+ -+ Store(\_SB.LMIN, MINL) -+ Store(\_SB.HMIN, MINH) -+ Store(\_SB.LLEN, LENL) -+ Store(\_SB.HLEN, LENH) -+ Add(MINL, LENL, MAXL) -+ Add(MINH, LENH, MAXH) -+ If(LLess(MAXL, MINL)) { -+ Add(MAXH, One, MAXH) -+ } -+ If(LOr(MINH, LENL)) { -+ If(LEqual(MAXL, 0)) { -+ Subtract(MAXH, One, MAXH) -+ } -+ Subtract(MAXL, One, MAXL) -+ } -+ - Return (PRT0) - } - ---- a/tools/firmware/hvmloader/cacheattr.c -+++ b/tools/firmware/hvmloader/cacheattr.c -@@ -97,8 +97,7 @@ void cacheattr_init(void) - nr_var_ranges = (uint8_t)mtrr_cap; - if ( nr_var_ranges != 0 ) - { -- unsigned long base = pci_mem_start, size; -- int i; -+ uint64_t base = pci_mem_start, size; - - for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ ) - { -@@ -109,8 +108,22 @@ void cacheattr_init(void) - size >>= 1; - - wrmsr(MSR_MTRRphysBase(i), base); -- wrmsr(MSR_MTRRphysMask(i), -- (~(uint64_t)(size-1) & addr_mask) | (1u << 11)); -+ wrmsr(MSR_MTRRphysMask(i), (~(size - 1) & addr_mask) | (1u << 11)); -+ -+ base += size; -+ } -+ -+ for ( base = pci_hi_mem_start; -+ (base != pci_hi_mem_end) && (i < nr_var_ranges); i++ ) -+ { -+ size = PAGE_SIZE; -+ while ( !(base & size) ) -+ size <<= 1; -+ while ( (base + size < base) || (base + size > pci_hi_mem_end) ) -+ size >>= 1; -+ -+ wrmsr(MSR_MTRRphysBase(i), base); -+ wrmsr(MSR_MTRRphysMask(i), (~(size - 1) & addr_mask) | (1u << 11)); - - base += size; - } ---- a/tools/firmware/hvmloader/config.h -+++ b/tools/firmware/hvmloader/config.h -@@ -57,7 +57,7 @@ extern struct bios_config ovmf_config; - #define PCI_MEM_END 0xfc000000 - - extern unsigned long pci_mem_start, pci_mem_end; -- -+extern uint64_t pci_hi_mem_start, pci_hi_mem_end; - - /* Memory map. */ - #define SCRATCH_PHYSICAL_ADDRESS 0x00010000 ---- a/tools/firmware/hvmloader/pci.c -+++ b/tools/firmware/hvmloader/pci.c -@@ -32,6 +32,7 @@ - - unsigned long pci_mem_start = PCI_MEM_START; - unsigned long pci_mem_end = PCI_MEM_END; -+uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0; - - enum virtual_vga virtual_vga = VGA_none; - unsigned long igd_opregion_pgbase = 0; -@@ -345,9 +346,8 @@ void pci_setup(void) - if ( high_mem_resource.base & (bar_sz - 1) ) - high_mem_resource.base = high_mem_resource.base - - (high_mem_resource.base & (bar_sz - 1)) + bar_sz; -- else -- high_mem_resource.base = high_mem_resource.base - -- (high_mem_resource.base & (bar_sz - 1)); -+ if ( !pci_hi_mem_start ) -+ pci_hi_mem_start = high_mem_resource.base; - resource = &high_mem_resource; - bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK; - } -@@ -398,6 +398,16 @@ void pci_setup(void) - pci_writew(devfn, PCI_COMMAND, cmd); - } - -+ if ( pci_hi_mem_start ) -+ { -+ /* -+ * Make end address alignment match the start address one's so that -+ * fewer variable range MTRRs are needed to cover the range. -+ */ -+ pci_hi_mem_end = ((high_mem_resource.base - 1) | -+ ((pci_hi_mem_start & -pci_hi_mem_start) - 1)) + 1; -+ } -+ - if ( vga_devfn != 256 ) - { - /* diff --git a/537cd0cc-hvmloader-PA-range-0xfc000000-0xffffffff-should-be-UC.patch b/537cd0cc-hvmloader-PA-range-0xfc000000-0xffffffff-should-be-UC.patch deleted file mode 100644 index 47aa269..0000000 --- a/537cd0cc-hvmloader-PA-range-0xfc000000-0xffffffff-should-be-UC.patch +++ /dev/null @@ -1,34 +0,0 @@ -# Commit c22bd567ce22f6ad9bd93318ad0d7fd1c2eadb0d -# Date 2014-05-21 18:14:04 +0200 -# Author Jan Beulich -# Committer Jan Beulich -hvmloader: PA range 0xfc000000-0xffffffff should be UC - -Rather than leaving the range from PCI_MEM_END (0xfc000000) to 4G -uncovered, we should include this in the UC range created for the (low) -PCI range. Besides being more correct, this also has the advantage that -with the way pci_setup() currently works the range will always be -mappable with a single variable range MTRR (rather than from 2 to 5 -depending on how much the lower boundary gets shifted down to -accommodate all devices). - -Signed-off-by: Jan Beulich -Acked-by: Ian Campbell - ---- a/tools/firmware/hvmloader/cacheattr.c -+++ b/tools/firmware/hvmloader/cacheattr.c -@@ -99,12 +99,12 @@ void cacheattr_init(void) - { - uint64_t base = pci_mem_start, size; - -- for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ ) -+ for ( i = 0; !(base >> 32) && (i < nr_var_ranges); i++ ) - { - size = PAGE_SIZE; - while ( !(base & size) ) - size <<= 1; -- while ( ((base + size) < base) || ((base + size) > pci_mem_end) ) -+ while ( ((base + size) < base) || ((base + size - 1) >> 32) ) - size >>= 1; - - wrmsr(MSR_MTRRphysBase(i), base); diff --git a/539ebe62-x86-EFI-improve-boot-time-diagnostics.patch b/539ebe62-x86-EFI-improve-boot-time-diagnostics.patch deleted file mode 100644 index e1efdb4..0000000 --- a/539ebe62-x86-EFI-improve-boot-time-diagnostics.patch +++ /dev/null @@ -1,61 +0,0 @@ -# Commit ebbb51dc8c1790e5187442a808003298b6796762 -# Date 2014-06-16 11:52:34 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/EFI: improve boot time diagnostics - -To aid analysis of eventual errors, print EFI status codes with error -messages where available. Also remove a case where the status gets -stored into a local variable without being used examined (which mis- -guided me to add an error check there in try 1 of this patch). - -Signed-off-by: Jan Beulich - ---- a/xen/arch/x86/efi/boot.c -+++ b/xen/arch/x86/efi/boot.c -@@ -344,11 +344,12 @@ static EFI_FILE_HANDLE __init get_parent - ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle, - &fs_protocol, (void **)&fio); - if ( EFI_ERROR(ret) ) -- blexit(L"Couldn't obtain the File System Protocol Interface"); -+ PrintErrMesg(L"Couldn't obtain the File System Protocol Interface", -+ ret); - ret = fio->OpenVolume(fio, &dir_handle); - } while ( ret == EFI_MEDIA_CHANGED ); - if ( ret != EFI_SUCCESS ) -- blexit(L"OpenVolume failure"); -+ PrintErrMesg(L"OpenVolume failure", ret); - - #define buffer ((CHAR16 *)keyhandler_scratch) - #define BUFFERSIZE sizeof(keyhandler_scratch) -@@ -967,8 +968,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY - - if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL, - (void **)&shim_lock)) && -- shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS ) -- blexit(L"Dom0 kernel image could not be verified."); -+ (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS ) -+ PrintErrMesg(L"Dom0 kernel image could not be verified", status); - - name.s = get_value(&cfg, section.s, "ramdisk"); - if ( name.s ) -@@ -1379,8 +1380,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY - } - } - -- status = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key, -- &efi_mdesc_size, &mdesc_ver); -+ efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key, -+ &efi_mdesc_size, &mdesc_ver); - mbi.mem_upper -= efi_memmap_size; - mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR); - if ( mbi.mem_upper < xen_phys_start ) -@@ -1389,7 +1390,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY - status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key, - &efi_mdesc_size, &mdesc_ver); - if ( EFI_ERROR(status) ) -- blexit(L"Cannot obtain memory map"); -+ PrintErrMesg(L"Cannot obtain memory map", status); - - /* Populate E820 table and check trampoline area availability. */ - e = e820map - 1; diff --git a/53aac342-x86-HVM-consolidate-and-sanitize-CR4-guest-reserved-bit-determination.patch b/53aac342-x86-HVM-consolidate-and-sanitize-CR4-guest-reserved-bit-determination.patch deleted file mode 100644 index f1fc24f..0000000 --- a/53aac342-x86-HVM-consolidate-and-sanitize-CR4-guest-reserved-bit-determination.patch +++ /dev/null @@ -1,169 +0,0 @@ -# Commit dab11417da4e21f43625f4ebbb68158f07003d04 -# Date 2014-06-25 14:40:34 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/HVM: consolidate and sanitize CR4 guest reserved bit determination - -First of all, this is needed by just a single source file, so it gets -moved there instead of getting fed to the compiler for most other -source files too. With that it becomes sensible for this to no longer -be a macro, allowing elimination of the mostly redundant helpers -hvm_vcpu_has_{smep,smap}(). And finally, following the model SMEP and -SMAP already used, tie the determination of reserved bits to the -features the guest is shown rather than the host's. - -Signed-off-by: Jan Beulich -Reviewed-by: Andrew Cooper - -Index: xen-4.4.1-testing/xen/arch/x86/hvm/hvm.c -=================================================================== ---- xen-4.4.1-testing.orig/xen/arch/x86/hvm/hvm.c -+++ xen-4.4.1-testing/xen/arch/x86/hvm/hvm.c -@@ -827,6 +827,73 @@ static bool_t hvm_efer_valid(struct doma - ((value & (EFER_LME|EFER_LMA)) == EFER_LMA)); - } - -+/* These reserved bits in lower 32 remain 0 after any load of CR0 */ -+#define HVM_CR0_GUEST_RESERVED_BITS \ -+ (~((unsigned long) \ -+ (X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | \ -+ X86_CR0_TS | X86_CR0_ET | X86_CR0_NE | \ -+ X86_CR0_WP | X86_CR0_AM | X86_CR0_NW | \ -+ X86_CR0_CD | X86_CR0_PG))) -+ -+/* These bits in CR4 cannot be set by the guest. */ -+static unsigned long hvm_cr4_guest_reserved_bits(const struct vcpu *v, -+ bool_t restore) -+{ -+ unsigned int leaf1_ecx = 0, leaf1_edx = 0; -+ unsigned int leaf7_0_ebx = 0, leaf7_0_ecx = 0; -+ -+ if ( likely(!restore) ) -+ { -+ unsigned int level; -+ -+ ASSERT(v == current); -+ hvm_cpuid(0, &level, NULL, NULL, NULL); -+ if ( level >= 1 ) -+ hvm_cpuid(1, NULL, NULL, &leaf1_ecx, &leaf1_edx); -+ if ( level >= 7 ) -+ hvm_cpuid(7, NULL, &leaf7_0_ebx, &leaf7_0_ecx, NULL); -+ } -+ else -+ { -+ leaf1_edx = boot_cpu_data.x86_capability[X86_FEATURE_VME / 32]; -+ leaf1_ecx = boot_cpu_data.x86_capability[X86_FEATURE_PCID / 32]; -+ leaf7_0_ebx = boot_cpu_data.x86_capability[X86_FEATURE_FSGSBASE / 32]; -+ } -+ -+ return ~(unsigned long) -+ ((leaf1_edx & cpufeat_mask(X86_FEATURE_VME) ? -+ X86_CR4_VME | X86_CR4_PVI : 0) | -+ (leaf1_edx & cpufeat_mask(X86_FEATURE_TSC) ? -+ X86_CR4_TSD : 0) | -+ (leaf1_edx & cpufeat_mask(X86_FEATURE_DE) ? -+ X86_CR4_DE : 0) | -+ (leaf1_edx & cpufeat_mask(X86_FEATURE_PSE) ? -+ X86_CR4_PSE : 0) | -+ (leaf1_edx & cpufeat_mask(X86_FEATURE_PAE) ? -+ X86_CR4_PAE : 0) | -+ (leaf1_edx & (cpufeat_mask(X86_FEATURE_MCE) | -+ cpufeat_mask(X86_FEATURE_MCA)) ? -+ X86_CR4_MCE : 0) | -+ (leaf1_edx & cpufeat_mask(X86_FEATURE_PGE) ? -+ X86_CR4_PGE : 0) | -+ X86_CR4_PCE | -+ (leaf1_edx & cpufeat_mask(X86_FEATURE_FXSR) ? -+ X86_CR4_OSFXSR : 0) | -+ (leaf1_edx & cpufeat_mask(X86_FEATURE_XMM) ? -+ X86_CR4_OSXMMEXCPT : 0) | -+ ((restore || nestedhvm_enabled(v->domain)) && -+ (leaf1_ecx & cpufeat_mask(X86_FEATURE_VMXE)) ? -+ X86_CR4_VMXE : 0) | -+ (leaf7_0_ebx & cpufeat_mask(X86_FEATURE_FSGSBASE) ? -+ X86_CR4_FSGSBASE : 0) | -+ (leaf1_ecx & cpufeat_mask(X86_FEATURE_PCID) ? -+ X86_CR4_PCIDE : 0) | -+ (leaf1_ecx & cpufeat_mask(X86_FEATURE_XSAVE) ? -+ X86_CR4_OSXSAVE : 0) | -+ (leaf7_0_ebx & cpufeat_mask(X86_FEATURE_SMEP) ? -+ X86_CR4_SMEP : 0)); -+} -+ - static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) - { - int vcpuid; -@@ -857,7 +924,7 @@ static int hvm_load_cpu_ctxt(struct doma - return -EINVAL; - } - -- if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) ) -+ if ( ctxt.cr4 & hvm_cr4_guest_reserved_bits(v, 1) ) - { - printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n", - d->domain_id, ctxt.cr4); -@@ -1981,7 +2048,7 @@ int hvm_set_cr4(unsigned long value) - struct vcpu *v = current; - unsigned long old_cr; - -- if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) ) -+ if ( value & hvm_cr4_guest_reserved_bits(v, 0) ) - { - HVM_DBG_LOG(DBG_LEVEL_1, - "Guest attempts to set reserved bit in CR4: %lx", -Index: xen-4.4.1-testing/xen/include/asm-x86/hvm/hvm.h -=================================================================== ---- xen-4.4.1-testing.orig/xen/include/asm-x86/hvm/hvm.h -+++ xen-4.4.1-testing/xen/include/asm-x86/hvm/hvm.h -@@ -347,51 +347,10 @@ static inline int hvm_event_pending(stru - return hvm_funcs.event_pending(v); - } - --static inline bool_t hvm_vcpu_has_smep(void) --{ -- unsigned int eax, ebx; -- -- hvm_cpuid(0, &eax, NULL, NULL, NULL); -- -- if ( eax < 7 ) -- return 0; -- -- hvm_cpuid(7, NULL, &ebx, NULL, NULL); -- return !!(ebx & cpufeat_mask(X86_FEATURE_SMEP)); --} -- --/* These reserved bits in lower 32 remain 0 after any load of CR0 */ --#define HVM_CR0_GUEST_RESERVED_BITS \ -- (~((unsigned long) \ -- (X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | \ -- X86_CR0_TS | X86_CR0_ET | X86_CR0_NE | \ -- X86_CR0_WP | X86_CR0_AM | X86_CR0_NW | \ -- X86_CR0_CD | X86_CR0_PG))) -- - /* These bits in CR4 are owned by the host. */ - #define HVM_CR4_HOST_MASK (mmu_cr4_features & \ - (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE)) - --/* These bits in CR4 cannot be set by the guest. */ --#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({ \ -- const struct vcpu *_v = (v); \ -- bool_t _restore = !!(restore); \ -- ASSERT((_restore) || _v == current); \ -- (~((unsigned long) \ -- (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD | \ -- X86_CR4_DE | X86_CR4_PSE | X86_CR4_PAE | \ -- X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE | \ -- X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT | \ -- (((_restore) ? cpu_has_smep : \ -- hvm_vcpu_has_smep()) ? \ -- X86_CR4_SMEP : 0) | \ -- (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) | \ -- ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \ -- ? X86_CR4_VMXE : 0) | \ -- (cpu_has_pcid ? X86_CR4_PCIDE : 0) | \ -- (cpu_has_xsave ? X86_CR4_OSXSAVE : 0)))); \ --}) -- - /* These exceptions must always be intercepted. */ - #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op)) - diff --git a/53c9151b-Fix-xl-vncviewer-accesses-port-0-by-any-invalid-domid.patch b/53c9151b-Fix-xl-vncviewer-accesses-port-0-by-any-invalid-domid.patch deleted file mode 100644 index a27dd81..0000000 --- a/53c9151b-Fix-xl-vncviewer-accesses-port-0-by-any-invalid-domid.patch +++ /dev/null @@ -1,39 +0,0 @@ -Subject: xl: 'xl vncviewer' accesses port 0 by any invalid domid -From: Chunyan Liu cyliu@suse.com Fri Jul 18 14:18:04 2014 +0800 -Date: Fri Jul 18 13:37:47 2014 +0100: -Git: 2a8cc1a55329ead252ed323ec4bbee534d5c0f23 - -Currently, with command: - xl vncviewer invalid_domid -it always brings user to the domU using vncport 5900. -The invalid domid could be an non-existing one or Dom0. -It's better to report error in this case. - -Correct libxl_vncviewer_exec: - In existing code, when vncport is NULL, it still continues - and will show vncport 5900. So, with 'xl vncviewer 0' it also - wrongly shows domU using vncport 5900. Correct it to report error - if vncport is NULL. - -Signed-off-by: Chunyan Liu -Acked-by: Ian Campbell - -Index: xen-4.4.0-testing/tools/libxl/libxl.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxl.c -+++ xen-4.4.0-testing/tools/libxl/libxl.c -@@ -1635,8 +1635,12 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, - vnc_port = libxl__xs_read(gc, XBT_NULL, - libxl__sprintf(gc, - "/local/domain/%d/console/vnc-port", domid)); -- if ( vnc_port ) -- port = atoi(vnc_port) - 5900; -+ if (!vnc_port) { -+ LOG(ERROR, "Cannot get vnc-port of domain %d", domid); -+ goto x_fail; -+ } -+ -+ port = atoi(vnc_port) - 5900; - - vnc_listen = libxl__xs_read(gc, XBT_NULL, - libxl__sprintf(gc, diff --git a/53d124e7-fix-list_domain_details-check-config-data-length-0.patch b/53d124e7-fix-list_domain_details-check-config-data-length-0.patch deleted file mode 100644 index cb9e247..0000000 --- a/53d124e7-fix-list_domain_details-check-config-data-length-0.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ef8cf0d4902c90595a0b0766e2a9a6ecbcbc4581 Mon Sep 17 00:00:00 2001 -From: Chunyan Liu -Date: Wed, 23 Jul 2014 17:42:09 +0800 -Subject: [PATCH] fix list_domain_details: check config data length=0 - -If domain is created through virsh, then in xl, one could see it -with 'xl list', but with 'xl list --long domU', it reports: -"Domain name must be specified." -The reason is xl config data does not exist but it still tries -to parse_config_data in current code. - -Improve list_domain_details: -If len of config data is 0, just pass, do not go forward to -parse_config_data, otherwise, it will meet error like -"Domain name not specified" and exit. This error is not expected, -since if code enters list_domain_details, domain name validness -is already checked and domain does exist. - -Length of config data is 0 may means: config data does not exist due -to some reason, like: domain is created by libvirt, or in destroying -domain process config data is cleared but domain fails to clean up. -No matter in which case, list_domain_details could just show empty -info, but not error like "Domain name not specified". - -Signed-off-by: Chunyan Liu -Acked-by: Ian Jackson ---- - tools/libxl/xl_cmdimpl.c | 2 ++ - 1 file changed, 2 insertions(+) - -Index: xen-4.4.0-testing/tools/libxl/xl_cmdimpl.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/xl_cmdimpl.c -+++ xen-4.4.0-testing/tools/libxl/xl_cmdimpl.c -@@ -3198,6 +3198,8 @@ static void list_domains_details(const l - rc = libxl_userdata_retrieve(ctx, info[i].domid, "xl", &data, &len); - if (rc) - continue; -+ if (len == 0) -+ continue; - CHK_SYSCALL(asprintf(&config_source, "", info[i].domid)); - libxl_domain_config_init(&d_config); - parse_config_data(config_source, (char *)data, len, &d_config, NULL); diff --git a/53dba447-x86-ACPI-allow-CMOS-RTC-use-even-when-ACPI-says-there-is-none.patch b/53dba447-x86-ACPI-allow-CMOS-RTC-use-even-when-ACPI-says-there-is-none.patch deleted file mode 100644 index 4a19b12..0000000 --- a/53dba447-x86-ACPI-allow-CMOS-RTC-use-even-when-ACPI-says-there-is-none.patch +++ /dev/null @@ -1,166 +0,0 @@ -References: bnc#883112 - -# Commit e9425f05b90811458a08355a55a0b0d608c440cf -# Date 2014-08-01 16:29:27 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/ACPI: allow CMOS RTC use even when ACPI says there is none - -HP is setting the ACPI_FADT_NO_CMOS_RTC flag on newer systems, -regardless of whether they're being booted from UEFI. Add a command -line option to allow probing for a working RTC in that case. - -Signed-off-by: Jan Beulich -Reviewed-by: Andrew Cooper - ---- a/docs/misc/xen-command-line.markdown -+++ b/docs/misc/xen-command-line.markdown -@@ -207,6 +207,14 @@ If set, override Xen's calculation of th - - If set, override Xen's default choice for the platform timer. - -+### cmos-rtc-probe -+> `= ` -+ -+> Default: `false` -+ -+Flag to indicate whether to probe for a CMOS Real Time Clock irrespective of -+ACPI indicating none to be there. -+ - ### com1,com2 - > `= [/][,[DPS][,[|pci|amt][,[][,[][,[]]]]]]` - ---- a/xen/arch/x86/time.c -+++ b/xen/arch/x86/time.c -@@ -651,37 +651,40 @@ mktime (unsigned int year, unsigned int - )*60 + sec; /* finally seconds */ - } - --static unsigned long __get_cmos_time(void) --{ -+struct rtc_time { - unsigned int year, mon, day, hour, min, sec; -+}; - -- sec = CMOS_READ(RTC_SECONDS); -- min = CMOS_READ(RTC_MINUTES); -- hour = CMOS_READ(RTC_HOURS); -- day = CMOS_READ(RTC_DAY_OF_MONTH); -- mon = CMOS_READ(RTC_MONTH); -- year = CMOS_READ(RTC_YEAR); -+static void __get_cmos_time(struct rtc_time *rtc) -+{ -+ rtc->sec = CMOS_READ(RTC_SECONDS); -+ rtc->min = CMOS_READ(RTC_MINUTES); -+ rtc->hour = CMOS_READ(RTC_HOURS); -+ rtc->day = CMOS_READ(RTC_DAY_OF_MONTH); -+ rtc->mon = CMOS_READ(RTC_MONTH); -+ rtc->year = CMOS_READ(RTC_YEAR); - - if ( !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD ) - { -- BCD_TO_BIN(sec); -- BCD_TO_BIN(min); -- BCD_TO_BIN(hour); -- BCD_TO_BIN(day); -- BCD_TO_BIN(mon); -- BCD_TO_BIN(year); -+ BCD_TO_BIN(rtc->sec); -+ BCD_TO_BIN(rtc->min); -+ BCD_TO_BIN(rtc->hour); -+ BCD_TO_BIN(rtc->day); -+ BCD_TO_BIN(rtc->mon); -+ BCD_TO_BIN(rtc->year); - } - -- if ( (year += 1900) < 1970 ) -- year += 100; -- -- return mktime(year, mon, day, hour, min, sec); -+ if ( (rtc->year += 1900) < 1970 ) -+ rtc->year += 100; - } - - static unsigned long get_cmos_time(void) - { - unsigned long res, flags; -- int i; -+ struct rtc_time rtc; -+ unsigned int seconds = 60; -+ static bool_t __read_mostly cmos_rtc_probe; -+ boolean_param("cmos-rtc-probe", cmos_rtc_probe); - - if ( efi_enabled ) - { -@@ -690,23 +693,58 @@ static unsigned long get_cmos_time(void) - return res; - } - -- if ( unlikely(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) ) -- panic("System without CMOS RTC must be booted from EFI"); -- -- spin_lock_irqsave(&rtc_lock, flags); -- -- /* read RTC exactly on falling edge of update flag */ -- for ( i = 0 ; i < 1000000 ; i++ ) /* may take up to 1 second... */ -- if ( (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) ) -+ if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) ) -+ cmos_rtc_probe = 0; -+ else if ( system_state < SYS_STATE_active && !cmos_rtc_probe ) -+ panic("System with no CMOS RTC advertised must be booted from EFI" -+ " (or with command line option \"cmos-rtc-probe\")"); -+ -+ for ( ; ; ) -+ { -+ s_time_t start, t1, t2; -+ -+ spin_lock_irqsave(&rtc_lock, flags); -+ -+ /* read RTC exactly on falling edge of update flag */ -+ start = NOW(); -+ do { /* may take up to 1 second... */ -+ t1 = NOW() - start; -+ } while ( !(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) && -+ t1 <= SECONDS(1) ); -+ -+ start = NOW(); -+ do { /* must try at least 2.228 ms */ -+ t2 = NOW() - start; -+ } while ( (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) && -+ t2 < MILLISECS(3) ); -+ -+ __get_cmos_time(&rtc); -+ -+ spin_unlock_irqrestore(&rtc_lock, flags); -+ -+ if ( likely(!cmos_rtc_probe) || -+ t1 > SECONDS(1) || t2 >= MILLISECS(3) || -+ rtc.sec >= 60 || rtc.min >= 60 || rtc.hour >= 24 || -+ !rtc.day || rtc.day > 31 || -+ !rtc.mon || rtc.mon > 12 ) - break; -- for ( i = 0 ; i < 1000000 ; i++ ) /* must try at least 2.228 ms */ -- if ( !(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) ) -+ -+ if ( seconds < 60 ) -+ { -+ if ( rtc.sec != seconds ) -+ cmos_rtc_probe = 0; - break; -+ } -+ -+ process_pending_softirqs(); -+ -+ seconds = rtc.sec; -+ } - -- res = __get_cmos_time(); -+ if ( unlikely(cmos_rtc_probe) ) -+ panic("No CMOS RTC found - system must be booted from EFI"); - -- spin_unlock_irqrestore(&rtc_lock, flags); -- return res; -+ return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec); - } - - /*************************************************************************** diff --git a/53df727b-x86-HVM-extend-LAPIC-shortcuts-around-P2M-lookups.patch b/53df727b-x86-HVM-extend-LAPIC-shortcuts-around-P2M-lookups.patch deleted file mode 100644 index 2e1c94a..0000000 --- a/53df727b-x86-HVM-extend-LAPIC-shortcuts-around-P2M-lookups.patch +++ /dev/null @@ -1,112 +0,0 @@ -References: bnc#882089 - -# Commit fd1863847af15c3676348447755e1a1801f9d394 -# Date 2014-08-04 13:46:03 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/HVM: extend LAPIC shortcuts around P2M lookups - -... to all internally handled MMIO regions. It is in particular the -HPET page that, e.g. on Windows Server 2012 R2, can get heavily -accessed, and hence avoiding the unnecessary lookups is rather -beneficial (in the reported case a 40+-vCPU guest would previously not -have booted at all while with hvm_hap_nested_page_fault() shortcut -alone it was able to boot up in 18 minutes [i.e. still room for -improvement]). - -Note the apparently unrelated addition of a is_hvm_vcpu() check to the -__hvm_copy() code: Afaict for PVH this shortcut should never have taken -effect (since there's no LAPIC in that case). - -Signed-off-by: Jan Beulich -Reviewed-by: Tim Deegan - - ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -1521,11 +1521,14 @@ int hvm_hap_nested_page_fault(paddr_t gp - } - } - -- /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs, -- * a fast path for LAPIC accesses, skipping the p2m lookup. */ -+ /* -+ * No need to do the P2M lookup for internally handled MMIO, benefiting -+ * - 32-bit WinXP (& older Windows) on AMD CPUs for LAPIC accesses, -+ * - newer Windows (like Server 2012) for HPET accesses. -+ */ - if ( !nestedhvm_vcpu_in_guestmode(v) - && is_hvm_vcpu(v) -- && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(v))) ) -+ && hvm_mmio_internal(gpa) ) - { - if ( !handle_mmio() ) - hvm_inject_hw_exception(TRAP_gp_fault, 0); -@@ -2644,7 +2647,9 @@ static enum hvm_copy_result __hvm_copy( - - while ( todo > 0 ) - { -- count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo); -+ paddr_t gpa = addr & ~PAGE_MASK; -+ -+ count = min_t(int, PAGE_SIZE - gpa, todo); - - if ( flags & HVMCOPY_virt ) - { -@@ -2659,16 +2664,22 @@ static enum hvm_copy_result __hvm_copy( - hvm_inject_page_fault(pfec, addr); - return HVMCOPY_bad_gva_to_gfn; - } -+ gpa |= (paddr_t)gfn << PAGE_SHIFT; - } - else - { - gfn = addr >> PAGE_SHIFT; -+ gpa = addr; - } - -- /* For the benefit of 32-bit WinXP (& older Windows) on AMD CPUs, -- * a fast path for LAPIC accesses, skipping the p2m lookup. */ -+ /* -+ * No need to do the P2M lookup for internally handled MMIO, benefiting -+ * - 32-bit WinXP (& older Windows) on AMD CPUs for LAPIC accesses, -+ * - newer Windows (like Server 2012) for HPET accesses. -+ */ - if ( !nestedhvm_vcpu_in_guestmode(curr) -- && gfn == PFN_DOWN(vlapic_base_address(vcpu_vlapic(curr))) ) -+ && is_hvm_vcpu(curr) -+ && hvm_mmio_internal(gpa) ) - return HVMCOPY_bad_gfn_to_mfn; - - page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE); ---- a/xen/arch/x86/hvm/intercept.c -+++ b/xen/arch/x86/hvm/intercept.c -@@ -163,6 +163,18 @@ static int hvm_mmio_access(struct vcpu * - return rc; - } - -+bool_t hvm_mmio_internal(paddr_t gpa) -+{ -+ struct vcpu *curr = current; -+ unsigned int i; -+ -+ for ( i = 0; i < HVM_MMIO_HANDLER_NR; ++i ) -+ if ( hvm_mmio_handlers[i]->check_handler(curr, gpa) ) -+ return 1; -+ -+ return 0; -+} -+ - int hvm_mmio_intercept(ioreq_t *p) - { - struct vcpu *v = current; ---- a/xen/include/asm-x86/hvm/io.h -+++ b/xen/include/asm-x86/hvm/io.h -@@ -91,6 +91,7 @@ static inline int hvm_buffered_io_interc - return hvm_io_intercept(p, HVM_BUFFERED_IO); - } - -+bool_t hvm_mmio_internal(paddr_t gpa); - int hvm_mmio_intercept(ioreq_t *p); - int hvm_buffered_io_send(ioreq_t *p); - diff --git a/53e8be5f-x86-vHPET-use-rwlock-instead-of-simple-one.patch b/53e8be5f-x86-vHPET-use-rwlock-instead-of-simple-one.patch deleted file mode 100644 index 938ff7f..0000000 --- a/53e8be5f-x86-vHPET-use-rwlock-instead-of-simple-one.patch +++ /dev/null @@ -1,194 +0,0 @@ -References: bnc#882089 - -# Commit ded2100990d1688b96c2edc7221887c56c1a8e04 -# Date 2014-08-11 15:00:15 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/vHPET: use rwlock instead of simple one - -This namely benefits guests heavily reading the main counter, but not -touching the HPET much otherwise. Note that due to the way -hpet_get_comparator() works hpet_read() has to special cases reads from -the comparator registers and use a write lock there instead of the read -one used for all other registers. - -Signed-off-by: Jan Beulich - ---- a/xen/arch/x86/hvm/hpet.c -+++ b/xen/arch/x86/hvm/hpet.c -@@ -75,7 +75,7 @@ - - static inline uint64_t hpet_read_maincounter(HPETState *h) - { -- ASSERT(spin_is_locked(&h->lock)); -+ ASSERT(rw_is_locked(&h->lock)); - - if ( hpet_enabled(h) ) - return guest_time_hpet(h) + h->mc_offset; -@@ -88,6 +88,8 @@ static uint64_t hpet_get_comparator(HPET - uint64_t comparator; - uint64_t elapsed; - -+ ASSERT(rw_is_write_locked(&h->lock)); -+ - comparator = h->hpet.comparator64[tn]; - if ( timer_is_periodic(h, tn) ) - { -@@ -172,16 +174,24 @@ static int hpet_read( - goto out; - } - -- spin_lock(&h->lock); -+ result = addr < HPET_Tn_CMP(0) || -+ ((addr - HPET_Tn_CMP(0)) % (HPET_Tn_CMP(1) - HPET_Tn_CMP(0))) > 7; -+ if ( result ) -+ read_lock(&h->lock); -+ else -+ write_lock(&h->lock); - - val = hpet_read64(h, addr); - -+ if ( result ) -+ read_unlock(&h->lock); -+ else -+ write_unlock(&h->lock); -+ - result = val; - if ( length != 8 ) - result = (val >> ((addr & 7) * 8)) & ((1ULL << (length * 8)) - 1); - -- spin_unlock(&h->lock); -- - out: - *pval = result; - return X86EMUL_OKAY; -@@ -190,7 +200,7 @@ static int hpet_read( - static void hpet_stop_timer(HPETState *h, unsigned int tn) - { - ASSERT(tn < HPET_TIMER_NUM); -- ASSERT(spin_is_locked(&h->lock)); -+ ASSERT(rw_is_write_locked(&h->lock)); - destroy_periodic_time(&h->pt[tn]); - /* read the comparator to get it updated so a read while stopped will - * return the expected value. */ -@@ -208,7 +218,7 @@ static void hpet_set_timer(HPETState *h, - unsigned int oneshot; - - ASSERT(tn < HPET_TIMER_NUM); -- ASSERT(spin_is_locked(&h->lock)); -+ ASSERT(rw_is_write_locked(&h->lock)); - - if ( (tn == 0) && (h->hpet.config & HPET_CFG_LEGACY) ) - { -@@ -289,7 +299,7 @@ static int hpet_write( - if ( hpet_check_access_length(addr, length) != 0 ) - goto out; - -- spin_lock(&h->lock); -+ write_lock(&h->lock); - - old_val = hpet_read64(h, addr); - new_val = val; -@@ -448,7 +458,7 @@ static int hpet_write( - #undef set_start_timer - #undef set_restart_timer - -- spin_unlock(&h->lock); -+ write_unlock(&h->lock); - - out: - return X86EMUL_OKAY; -@@ -473,7 +483,7 @@ static int hpet_save(struct domain *d, h - HPETState *hp = domain_vhpet(d); - int rc; - -- spin_lock(&hp->lock); -+ write_lock(&hp->lock); - - /* Write the proper value into the main counter */ - hp->hpet.mc64 = hp->mc_offset + guest_time_hpet(hp); -@@ -507,7 +517,7 @@ static int hpet_save(struct domain *d, h - rec->timers[2].cmp = hp->hpet.comparator64[2]; - } - -- spin_unlock(&hp->lock); -+ write_unlock(&hp->lock); - - return rc; - } -@@ -519,12 +529,12 @@ static int hpet_load(struct domain *d, h - uint64_t cmp; - int i; - -- spin_lock(&hp->lock); -+ write_lock(&hp->lock); - - /* Reload the HPET registers */ - if ( _hvm_check_entry(h, HVM_SAVE_CODE(HPET), HVM_SAVE_LENGTH(HPET), 1) ) - { -- spin_unlock(&hp->lock); -+ write_unlock(&hp->lock); - return -EINVAL; - } - -@@ -564,7 +574,7 @@ static int hpet_load(struct domain *d, h - if ( timer_enabled(hp, i) ) - hpet_set_timer(hp, i); - -- spin_unlock(&hp->lock); -+ write_unlock(&hp->lock); - - return 0; - } -@@ -578,7 +588,7 @@ void hpet_init(struct vcpu *v) - - memset(h, 0, sizeof(HPETState)); - -- spin_lock_init(&h->lock); -+ rwlock_init(&h->lock); - - h->stime_freq = S_TO_NS; - -@@ -607,14 +617,14 @@ void hpet_deinit(struct domain *d) - int i; - HPETState *h = domain_vhpet(d); - -- spin_lock(&h->lock); -+ write_lock(&h->lock); - - if ( hpet_enabled(h) ) - for ( i = 0; i < HPET_TIMER_NUM; i++ ) - if ( timer_enabled(h, i) ) - hpet_stop_timer(h, i); - -- spin_unlock(&h->lock); -+ write_unlock(&h->lock); - } - - void hpet_reset(struct domain *d) ---- a/xen/arch/x86/hvm/vpt.c -+++ b/xen/arch/x86/hvm/vpt.c -@@ -508,10 +508,10 @@ void pt_adjust_global_vcpu_target(struct - pt_adjust_vcpu(&pl_time->vrtc.pt, v); - spin_unlock(&pl_time->vrtc.lock); - -- spin_lock(&pl_time->vhpet.lock); -+ write_lock(&pl_time->vhpet.lock); - for ( i = 0; i < HPET_TIMER_NUM; i++ ) - pt_adjust_vcpu(&pl_time->vhpet.pt[i], v); -- spin_unlock(&pl_time->vhpet.lock); -+ write_unlock(&pl_time->vhpet.lock); - } - - ---- a/xen/include/asm-x86/hvm/vpt.h -+++ b/xen/include/asm-x86/hvm/vpt.h -@@ -96,7 +96,7 @@ typedef struct HPETState { - uint64_t hpet_to_ns_limit; /* max hpet ticks convertable to ns */ - uint64_t mc_offset; - struct periodic_time pt[HPET_TIMER_NUM]; -- spinlock_t lock; -+ rwlock_t lock; - } HPETState; - - typedef struct RTCState { diff --git a/53f737b1-VMX-fix-DebugCtl-MSR-clearing.patch b/53f737b1-VMX-fix-DebugCtl-MSR-clearing.patch deleted file mode 100644 index 97d07b3..0000000 --- a/53f737b1-VMX-fix-DebugCtl-MSR-clearing.patch +++ /dev/null @@ -1,39 +0,0 @@ -# Commit dfa625e15f3d6c374637f2bb789e1f444c2781c3 -# Date 2014-08-22 14:29:37 +0200 -# Author Jan Beulich -# Committer Jan Beulich -VMX: fix DebugCtl MSR clearing - -The previous shortcut was wrong, as it bypassed the necessary vmwrite: -All we really want to avoid if the guest writes zero is to add the MSR -to the host-load list. - -Signed-off-by: Jan Beulich -Reviewed-by: Andrew Cooper -Acked-by: Kevin Tian - ---- a/xen/arch/x86/hvm/vmx/vmx.c -+++ b/xen/arch/x86/hvm/vmx/vmx.c -@@ -2170,8 +2170,6 @@ static int vmx_msr_write_intercept(unsig - int i, rc = 0; - uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF; - -- if ( !msr_content ) -- break; - if ( msr_content & ~supported ) - { - /* Perhaps some other bits are supported in vpmu. */ -@@ -2191,12 +2189,10 @@ static int vmx_msr_write_intercept(unsig - } - - if ( (rc < 0) || -- (vmx_add_host_load_msr(msr) < 0) ) -+ (msr_content && (vmx_add_host_load_msr(msr) < 0)) ) - hvm_inject_hw_exception(TRAP_machine_check, 0); - else -- { - __vmwrite(GUEST_IA32_DEBUGCTL, msr_content); -- } - - break; - } diff --git a/53f7386d-x86-irq-process-softirqs-in-irq-keyhandlers.patch b/53f7386d-x86-irq-process-softirqs-in-irq-keyhandlers.patch deleted file mode 100644 index bd23790..0000000 --- a/53f7386d-x86-irq-process-softirqs-in-irq-keyhandlers.patch +++ /dev/null @@ -1,119 +0,0 @@ -# Commit e13b3203990706db1313ec2aadd9a30b249ee793 -# Date 2014-08-22 14:32:45 +0200 -# Author Andrew Cooper -# Committer Jan Beulich -x86/irq: process softirqs in irq keyhandlers - -Large machines with lots of interrupts can trip over the Xen watchdog. - -Suggested-by: Santosh Jodh -Signed-off-by: Andrew Cooper -Tested-by: Santosh Jodh - -# Commit bd083922f9e78ed19ef98e7de372e5f568402ed3 -# Date 2014-08-26 17:56:52 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/IO-APIC: don't process softirqs during early boot - -Commit e13b320399 ("x86/irq: process softirqs in irq keyhandlers") -made this unconditional, but the boot time use of __print_IO_APIC() -(when "apic_verbosity=debug" was given) can't tolerate that. - -Reported-by: Sander Eikelenboom -Signed-off-by: Jan Beulich -Reviewed-by: Andrew Cooper -Tested-by: Sander Eikelenboom - ---- a/xen/arch/x86/io_apic.c -+++ b/xen/arch/x86/io_apic.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1091,7 +1092,7 @@ static inline void UNEXPECTED_IO_APIC(vo - { - } - --static void /*__init*/ __print_IO_APIC(void) -+static void /*__init*/ __print_IO_APIC(bool_t boot) - { - int apic, i; - union IO_APIC_reg_00 reg_00; -@@ -1112,6 +1113,9 @@ static void /*__init*/ __print_IO_APIC(v - printk(KERN_INFO "testing the IO APIC.......................\n"); - - for (apic = 0; apic < nr_ioapics; apic++) { -+ if ( !boot ) -+ process_pending_softirqs(); -+ - if (!nr_ioapic_entries[apic]) - continue; - -@@ -1215,6 +1219,10 @@ static void /*__init*/ __print_IO_APIC(v - printk(KERN_DEBUG "IRQ to pin mappings:\n"); - for (i = 0; i < nr_irqs_gsi; i++) { - struct irq_pin_list *entry = irq_2_pin + i; -+ -+ if ( !boot && !(i & 0x1f) ) -+ process_pending_softirqs(); -+ - if (entry->pin < 0) - continue; - printk(KERN_DEBUG "IRQ%d ", irq_to_desc(i)->arch.vector); -@@ -1235,12 +1243,12 @@ static void /*__init*/ __print_IO_APIC(v - static void __init print_IO_APIC(void) - { - if (apic_verbosity != APIC_QUIET) -- __print_IO_APIC(); -+ __print_IO_APIC(1); - } - - static void _print_IO_APIC_keyhandler(unsigned char key) - { -- __print_IO_APIC(); -+ __print_IO_APIC(0); - } - static struct keyhandler print_IO_APIC_keyhandler = { - .diagnostic = 1, -@@ -2454,6 +2462,9 @@ void dump_ioapic_irq_info(void) - - for ( irq = 0; irq < nr_irqs_gsi; irq++ ) - { -+ if ( !(irq & 0x1f) ) -+ process_pending_softirqs(); -+ - entry = &irq_2_pin[irq]; - if ( entry->pin == -1 ) - continue; ---- a/xen/arch/x86/irq.c -+++ b/xen/arch/x86/irq.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -2231,6 +2232,8 @@ static void dump_irqs(unsigned char key) - - for ( irq = 0; irq < nr_irqs; irq++ ) - { -+ if ( !(irq & 0x1f) ) -+ process_pending_softirqs(); - - desc = irq_to_desc(irq); - -@@ -2284,6 +2287,7 @@ static void dump_irqs(unsigned char key) - xfree(ssid); - } - -+ process_pending_softirqs(); - printk("Direct vector information:\n"); - for ( i = FIRST_DYNAMIC_VECTOR; i < NR_VECTORS; ++i ) - if ( direct_apic_vector[i] ) diff --git a/53fcebab-xen-pass-kernel-initrd-to-qemu.patch b/53fcebab-xen-pass-kernel-initrd-to-qemu.patch deleted file mode 100644 index 07f5a66..0000000 --- a/53fcebab-xen-pass-kernel-initrd-to-qemu.patch +++ /dev/null @@ -1,335 +0,0 @@ -Subject: xen: pass kernel initrd to qemu -From: Chunyan Liu cyliu@suse.com Mon Jul 7 14:34:33 2014 +0800 -Date: Tue Aug 26 21:18:51 2014 +0100: -Git: 11dffa2359e8a2629490c14c029c7c7c777b3e47 - -xen side patch to support xen HVM direct kernel boot: -support 'kernel', 'ramdisk', 'cmdline' (and 'root', 'extra' as well -which would be deprecated later) in HVM config file, parse config file, -pass -kernel, -initrd, -append parameters to qemu. - -Signed-off-by: Chunyan Liu -Acked-by: Ian Campbell - -Index: xen-4.4.1-testing/docs/man/xl.cfg.pod.5 -=================================================================== ---- xen-4.4.1-testing.orig/docs/man/xl.cfg.pod.5 -+++ xen-4.4.1-testing/docs/man/xl.cfg.pod.5 -@@ -296,6 +296,37 @@ Action to take if the domain crashes. D - - =back - -+=head3 Direct Kernel Boot -+ -+Direct kernel boot allows booting directly from a kernel and initrd -+stored in the host physical machine OS, allowing command line arguments -+to be passed directly. PV guest direct kernel boot is supported. HVM -+guest direct kernel boot is supported with limitation (it's supported -+when using qemu-xen and default BIOS 'seabios'; not supported in case of -+stubdom-dm and old rombios.) -+ -+=over 4 -+ -+=item B -+ -+Load the specified file as the kernel image. -+ -+=item B -+ -+Load the specified file as the ramdisk. -+ -+=item B -+ -+Append B to the kernel command line (Note: it is guest -+specific what meaning this has). -+ -+=item B -+ -+Append B to the kernel command line. (Note: it is guest -+specific what meaning this has). -+ -+=back -+ - =head3 Other Options - - =over 4 -@@ -625,20 +656,12 @@ The following options apply only to Para - - =over 4 - --=item B -- --Load the specified file as the kernel image. Either B or --B must be specified for PV guests. -- --=item B -- --Load the specified file as the ramdisk. -- - =item B - - Run C to find the kernel image and ramdisk to use. Normally - C would be C, which is an emulation of --grub/grub2/syslinux. -+grub/grub2/syslinux. Either B or B must be specified -+for PV guests. - - =item B - -@@ -646,16 +669,6 @@ Append Bs to the arguments to the B - program. Alternatively if the argument is a simple string then it will - be split into words at whitespace (this second option is deprecated). - --=item B -- --Append B to the kernel command line (Note: it is guest --specific what meaning this has). -- --=item B -- --Append B to the kernel command line. Note: it is guest --specific what meaning this has). -- - =item B - - Selects whether to expose the host e820 (memory map) to the guest via -Index: xen-4.4.1-testing/tools/libxl/libxl.h -=================================================================== ---- xen-4.4.1-testing.orig/tools/libxl/libxl.h -+++ xen-4.4.1-testing/tools/libxl/libxl.h -@@ -445,6 +445,21 @@ - #define LIBXL_HAVE_NO_SUSPEND_RESUME 1 - #endif - -+/* -+ * LIBXL_HAVE_BUILDINFO_KERNEL -+ * -+ * If this is defined, then the libxl_domain_build_info structure will -+ * contain 'kernel', 'ramdisk', 'cmdline' fields. 'kernel' is a string -+ * to indicate kernel image location, 'ramdisk' is a string to indicate -+ * ramdisk location, 'cmdline' is a string to indicate the paramters which -+ * would be appended to kernel image. -+ * -+ * Both PV guest and HVM guest can use these fields for direct kernel boot. -+ * But for compatibility reason, u.pv.kernel, u.pv.ramdisk and u.pv.cmdline -+ * still exist. -+ */ -+#define LIBXL_HAVE_BUILDINFO_KERNEL 1 -+ - /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be - * called from within libxl itself. Callers outside libxl, who - * do not #include libxl_internal.h, are fine. */ -Index: xen-4.4.1-testing/tools/libxl/libxl_bootloader.c -=================================================================== ---- xen-4.4.1-testing.orig/tools/libxl/libxl_bootloader.c -+++ xen-4.4.1-testing/tools/libxl/libxl_bootloader.c -@@ -56,12 +56,12 @@ static void make_bootloader_args(libxl__ - - ARG(bootloader_path); - -- if (info->u.pv.kernel) -- ARG(libxl__sprintf(gc, "--kernel=%s", info->u.pv.kernel)); -- if (info->u.pv.ramdisk) -- ARG(libxl__sprintf(gc, "--ramdisk=%s", info->u.pv.ramdisk)); -- if (info->u.pv.cmdline && *info->u.pv.cmdline != '\0') -- ARG(libxl__sprintf(gc, "--args=%s", info->u.pv.cmdline)); -+ if (info->kernel) -+ ARG(libxl__sprintf(gc, "--kernel=%s", info->kernel)); -+ if (info->ramdisk) -+ ARG(libxl__sprintf(gc, "--ramdisk=%s", info->ramdisk)); -+ if (info->cmdline && *info->cmdline != '\0') -+ ARG(libxl__sprintf(gc, "--args=%s", info->cmdline)); - - ARG(libxl__sprintf(gc, "--output=%s", bl->outputpath)); - ARG("--output-format=simple0"); -@@ -325,9 +325,9 @@ void libxl__bootloader_run(libxl__egc *e - - if (!info->u.pv.bootloader) { - LOG(DEBUG, "no bootloader configured, using user supplied kernel"); -- bl->kernel->path = bl->info->u.pv.kernel; -- bl->ramdisk->path = bl->info->u.pv.ramdisk; -- bl->cmdline = bl->info->u.pv.cmdline; -+ bl->kernel->path = bl->info->kernel; -+ bl->ramdisk->path = bl->info->ramdisk; -+ bl->cmdline = bl->info->cmdline; - rc = 0; - goto out_ok; - } -Index: xen-4.4.1-testing/tools/libxl/libxl_create.c -=================================================================== ---- xen-4.4.1-testing.orig/tools/libxl/libxl_create.c -+++ xen-4.4.1-testing/tools/libxl/libxl_create.c -@@ -337,6 +337,25 @@ int libxl__domain_build_info_setdefault( - b_info->shadow_memkb = 0; - if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT) - b_info->u.pv.slack_memkb = 0; -+ -+ /* For compatibility, fill in b_info->kernel|ramdisk|cmdline -+ * with the value in u.pv, later processing will use -+ * b_info->kernel|ramdisk|cmdline only. -+ * User with old APIs that passes u.pv.kernel|ramdisk|cmdline -+ * is not affected. -+ */ -+ if (!b_info->kernel && b_info->u.pv.kernel) { -+ b_info->kernel = b_info->u.pv.kernel; -+ b_info->u.pv.kernel = NULL; -+ } -+ if (!b_info->ramdisk && b_info->u.pv.ramdisk) { -+ b_info->ramdisk = b_info->u.pv.ramdisk; -+ b_info->u.pv.ramdisk = NULL; -+ } -+ if (!b_info->cmdline && b_info->u.pv.cmdline) { -+ b_info->cmdline = b_info->u.pv.cmdline; -+ b_info->u.pv.cmdline = NULL; -+ } - break; - default: - LIBXL__LOG(CTX, LIBXL__LOG_ERROR, -Index: xen-4.4.1-testing/tools/libxl/libxl_dm.c -=================================================================== ---- xen-4.4.1-testing.orig/tools/libxl/libxl_dm.c -+++ xen-4.4.1-testing/tools/libxl/libxl_dm.c -@@ -196,6 +196,12 @@ static char ** libxl__build_device_model - int nr_set_cpus = 0; - char *s; - -+ if (b_info->kernel) { -+ LOG(ERROR, "HVM direct kernel boot is not supported by " -+ "qemu-xen-traditional"); -+ return NULL; -+ } -+ - if (b_info->u.hvm.serial) { - flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL); - } -@@ -481,6 +487,15 @@ static char ** libxl__build_device_model - if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) { - int ioemu_nics = 0; - -+ if (b_info->kernel) -+ flexarray_vappend(dm_args, "-kernel", b_info->kernel, NULL); -+ -+ if (b_info->ramdisk) -+ flexarray_vappend(dm_args, "-initrd", b_info->ramdisk, NULL); -+ -+ if (b_info->cmdline) -+ flexarray_vappend(dm_args, "-append", b_info->cmdline, NULL); -+ - if (b_info->u.hvm.serial) { - flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL); - } -Index: xen-4.4.1-testing/tools/libxl/libxl_types.idl -=================================================================== ---- xen-4.4.1-testing.orig/tools/libxl/libxl_types.idl -+++ xen-4.4.1-testing/tools/libxl/libxl_types.idl -@@ -333,6 +333,9 @@ libxl_domain_build_info = Struct("domain - ("iomem", Array(libxl_iomem_range, "num_iomem")), - ("claim_mode", libxl_defbool), - ("event_channels", uint32), -+ ("kernel", string), -+ ("cmdline", string), -+ ("ramdisk", string), - ("u", KeyedUnion(None, libxl_domain_type, "type", - [("hvm", Struct(None, [("firmware", string), - ("bios", libxl_bios_type), -Index: xen-4.4.1-testing/tools/libxl/xl_cmdimpl.c -=================================================================== ---- xen-4.4.1-testing.orig/tools/libxl/xl_cmdimpl.c -+++ xen-4.4.1-testing/tools/libxl/xl_cmdimpl.c -@@ -721,6 +721,29 @@ static void parse_top_level_vnc_options( - xlu_cfg_get_defbool(config, "vncunused", &vnc->findunused, 0); - } - -+static char *parse_cmdline(XLU_Config *config) -+{ -+ char *cmdline = NULL; -+ const char *root = NULL, *extra = ""; -+ -+ xlu_cfg_get_string (config, "root", &root, 0); -+ xlu_cfg_get_string (config, "extra", &extra, 0); -+ -+ if (root) { -+ if (asprintf(&cmdline, "root=%s %s", root, extra) == -1) -+ cmdline = NULL; -+ } else { -+ cmdline = strdup(extra); -+ } -+ -+ if ((root || extra) && !cmdline) { -+ fprintf(stderr, "Failed to allocate memory for cmdline\n"); -+ exit(1); -+ } -+ -+ return cmdline; -+} -+ - static void parse_config_data(const char *config_source, - const char *config_data, - int config_len, -@@ -998,13 +1021,21 @@ static void parse_config_data(const char - if (!xlu_cfg_get_long(config, "max_event_channels", &l, 0)) - b_info->event_channels = l; - -+ xlu_cfg_replace_string (config, "kernel", &b_info->kernel, 0); -+ xlu_cfg_replace_string (config, "ramdisk", &b_info->ramdisk, 0); -+ b_info->cmdline = parse_cmdline(config); -+ - xlu_cfg_get_defbool(config, "driver_domain", &c_info->driver_domain, 0); - - switch(b_info->type) { - case LIBXL_DOMAIN_TYPE_HVM: -- if (!xlu_cfg_get_string (config, "kernel", &buf, 0)) -- fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVM guest. " -- "Use \"firmware_override\" instead if you really want a non-default firmware\n"); -+ if (!strcmp(libxl_basename(b_info->kernel), "hvmloader")) { -+ fprintf(stderr, "WARNING: you seem to be using \"kernel\" " -+ "directive to override HVM guest firmware. Ignore " -+ "that. Use \"firmware_override\" instead if you " -+ "really want a non-default firmware\n"); -+ b_info->kernel = NULL; -+ } - - xlu_cfg_replace_string (config, "firmware_override", - &b_info->u.hvm.firmware, 0); -@@ -1056,26 +1087,6 @@ static void parse_config_data(const char - break; - case LIBXL_DOMAIN_TYPE_PV: - { -- char *cmdline = NULL; -- const char *root = NULL, *extra = ""; -- -- xlu_cfg_replace_string (config, "kernel", &b_info->u.pv.kernel, 0); -- -- xlu_cfg_get_string (config, "root", &root, 0); -- xlu_cfg_get_string (config, "extra", &extra, 0); -- -- if (root) { -- if (asprintf(&cmdline, "root=%s %s", root, extra) == -1) -- cmdline = NULL; -- } else { -- cmdline = strdup(extra); -- } -- -- if ((root || extra) && !cmdline) { -- fprintf(stderr, "Failed to allocate memory for cmdline\n"); -- exit(1); -- } -- - xlu_cfg_replace_string (config, "bootloader", &b_info->u.pv.bootloader, 0); - switch (xlu_cfg_get_list_as_string_list(config, "bootloader_args", - &b_info->u.pv.bootloader_args, 1)) -@@ -1098,13 +1109,11 @@ static void parse_config_data(const char - exit(-ERROR_FAIL); - } - -- if (!b_info->u.pv.bootloader && !b_info->u.pv.kernel) { -+ if (!b_info->u.pv.bootloader && !b_info->kernel) { - fprintf(stderr, "Neither kernel nor bootloader specified\n"); - exit(1); - } - -- b_info->u.pv.cmdline = cmdline; -- xlu_cfg_replace_string (config, "ramdisk", &b_info->u.pv.ramdisk, 0); - break; - } - default: diff --git a/53ff3659-x86-consolidate-boolean-inputs-in-hvm-and-p2m.patch b/53ff3659-x86-consolidate-boolean-inputs-in-hvm-and-p2m.patch deleted file mode 100644 index c02cf0e..0000000 --- a/53ff3659-x86-consolidate-boolean-inputs-in-hvm-and-p2m.patch +++ /dev/null @@ -1,331 +0,0 @@ -References: bnc#882089 - -# Commit 3d4d4f9336159f3f77a7b480ce9984fd3ff7949f -# Date 2014-08-28 16:02:01 +0200 -# Author Tamas K Lengyel -# Committer Jan Beulich -x86: consolidate boolean inputs in hvm and p2m into a shared bitmap - -This patch consolidates the boolean input parameters of -hvm_hap_nested_page_fault and p2m_mem_access_check into a common bitmap -and defines the bitmap members accordingly. - -Signed-off-by: Tamas K Lengyel -Reviewed-by: Jan Beulich -Acked-by: Kevin Tian -Reviewed-by: Tim Deegan - -# Commit 24857896a30105b7947e2cd36d63768054538bbc -# Date 2014-09-03 15:06:06 +0200 -# Author Andrew Cooper -# Committer Jan Beulich -x86/hvm: fix operator precedence bug introduced by 3d4d4f9336 - -Bitwise or has greater precedence than the ternary operator, making the result -of the expression a constant P2M_UNSHARE. - -Coverity-ID: 1234633 -Signed-off-by: Andrew Cooper -Signed-off-by: Jan Beulich -Reviewed-by: Don Slutz - ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -1464,12 +1464,8 @@ void hvm_inject_page_fault(int errcode, - hvm_inject_trap(&trap); - } - --int hvm_hap_nested_page_fault(paddr_t gpa, -- bool_t gla_valid, -- unsigned long gla, -- bool_t access_r, -- bool_t access_w, -- bool_t access_x) -+int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla, -+ struct npfec npfec) - { - unsigned long gfn = gpa >> PAGE_SHIFT; - p2m_type_t p2mt; -@@ -1498,8 +1494,11 @@ int hvm_hap_nested_page_fault(paddr_t gp - * into l1 guest if not fixable. The algorithm is - * the same as for shadow paging. - */ -- rv = nestedhvm_hap_nested_page_fault(v, &gpa, -- access_r, access_w, access_x); -+ -+ rv = nestedhvm_hap_nested_page_fault(v, &gpa, -+ npfec.read_access, -+ npfec.write_access, -+ npfec.insn_fetch); - switch (rv) { - case NESTEDHVM_PAGEFAULT_DONE: - case NESTEDHVM_PAGEFAULT_RETRY: -@@ -1538,47 +1537,49 @@ int hvm_hap_nested_page_fault(paddr_t gp - - p2m = p2m_get_hostp2m(v->domain); - mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, -- P2M_ALLOC | (access_w ? P2M_UNSHARE : 0), NULL); -+ P2M_ALLOC | (npfec.write_access ? P2M_UNSHARE : 0), -+ NULL); - - /* Check access permissions first, then handle faults */ - if ( mfn_x(mfn) != INVALID_MFN ) - { -- int violation = 0; -+ bool_t violation; -+ - /* If the access is against the permissions, then send to mem_event */ -- switch (p2ma) -+ switch (p2ma) - { - case p2m_access_n: - case p2m_access_n2rwx: - default: -- violation = access_r || access_w || access_x; -+ violation = npfec.read_access || npfec.write_access || npfec.insn_fetch; - break; - case p2m_access_r: -- violation = access_w || access_x; -+ violation = npfec.write_access || npfec.insn_fetch; - break; - case p2m_access_w: -- violation = access_r || access_x; -+ violation = npfec.read_access || npfec.insn_fetch; - break; - case p2m_access_x: -- violation = access_r || access_w; -+ violation = npfec.read_access || npfec.write_access; - break; - case p2m_access_rx: - case p2m_access_rx2rw: -- violation = access_w; -+ violation = npfec.write_access; - break; - case p2m_access_wx: -- violation = access_r; -+ violation = npfec.read_access; - break; - case p2m_access_rw: -- violation = access_x; -+ violation = npfec.insn_fetch; - break; - case p2m_access_rwx: -+ violation = 0; - break; - } - - if ( violation ) - { -- if ( p2m_mem_access_check(gpa, gla_valid, gla, access_r, -- access_w, access_x, &req_ptr) ) -+ if ( p2m_mem_access_check(gpa, gla, npfec, &req_ptr) ) - { - fall_through = 1; - } else { -@@ -1594,7 +1595,7 @@ int hvm_hap_nested_page_fault(paddr_t gp - * to the mmio handler. - */ - if ( (p2mt == p2m_mmio_dm) || -- (access_w && (p2mt == p2m_ram_ro)) ) -+ (npfec.write_access && (p2mt == p2m_ram_ro)) ) - { - put_gfn(p2m->domain, gfn); - -@@ -1613,7 +1614,7 @@ int hvm_hap_nested_page_fault(paddr_t gp - paged = 1; - - /* Mem sharing: unshare the page and try again */ -- if ( access_w && (p2mt == p2m_ram_shared) ) -+ if ( npfec.write_access && (p2mt == p2m_ram_shared) ) - { - ASSERT(!p2m_is_nestedp2m(p2m)); - sharing_enomem = -@@ -1630,7 +1631,7 @@ int hvm_hap_nested_page_fault(paddr_t gp - * a large page, we do not change other pages type within that large - * page. - */ -- if ( access_w ) -+ if ( npfec.write_access ) - { - paging_mark_dirty(v->domain, mfn_x(mfn)); - p2m_change_type(v->domain, gfn, p2m_ram_logdirty, p2m_ram_rw); -@@ -1640,7 +1641,7 @@ int hvm_hap_nested_page_fault(paddr_t gp - } - - /* Shouldn't happen: Maybe the guest was writing to a r/o grant mapping? */ -- if ( access_w && (p2mt == p2m_grant_map_ro) ) -+ if ( npfec.write_access && (p2mt == p2m_grant_map_ro) ) - { - gdprintk(XENLOG_WARNING, - "trying to write to read-only grant mapping\n"); ---- a/xen/arch/x86/hvm/svm/svm.c -+++ b/xen/arch/x86/hvm/svm/svm.c -@@ -1289,7 +1289,7 @@ const struct hvm_function_table * __init - } - - static void svm_do_nested_pgfault(struct vcpu *v, -- struct cpu_user_regs *regs, uint32_t npfec, paddr_t gpa) -+ struct cpu_user_regs *regs, uint32_t pfec, paddr_t gpa) - { - int ret; - unsigned long gfn = gpa >> PAGE_SHIFT; -@@ -1298,10 +1298,13 @@ static void svm_do_nested_pgfault(struct - p2m_access_t p2ma; - struct p2m_domain *p2m = NULL; - -- ret = hvm_hap_nested_page_fault(gpa, 0, ~0ul, -- 1, /* All NPFs count as reads */ -- npfec & PFEC_write_access, -- npfec & PFEC_insn_fetch); -+ struct npfec npfec = { -+ .read_access = 1, /* All NPFs count as reads */ -+ .write_access = !!(pfec & PFEC_write_access), -+ .insn_fetch = !!(pfec & PFEC_insn_fetch) -+ }; -+ -+ ret = hvm_hap_nested_page_fault(gpa, ~0ul, npfec); - - if ( tb_init_done ) - { -@@ -1329,7 +1332,7 @@ static void svm_do_nested_pgfault(struct - case -1: - ASSERT(nestedhvm_enabled(v->domain) && nestedhvm_vcpu_in_guestmode(v)); - /* inject #VMEXIT(NPF) into guest. */ -- nestedsvm_vmexit_defer(v, VMEXIT_NPF, npfec, gpa); -+ nestedsvm_vmexit_defer(v, VMEXIT_NPF, pfec, gpa); - return; - } - ---- a/xen/arch/x86/hvm/vmx/vmx.c -+++ b/xen/arch/x86/hvm/vmx/vmx.c -@@ -2278,6 +2278,11 @@ static void ept_handle_violation(unsigne - p2m_type_t p2mt; - int ret; - struct domain *d = current->domain; -+ struct npfec npfec = { -+ .read_access = !!(qualification & EPT_READ_VIOLATION), -+ .write_access = !!(qualification & EPT_WRITE_VIOLATION), -+ .insn_fetch = !!(qualification & EPT_EXEC_VIOLATION) -+ }; - - if ( tb_init_done ) - { -@@ -2296,14 +2301,14 @@ static void ept_handle_violation(unsigne - } - - if ( qualification & EPT_GLA_VALID ) -+ { - __vmread(GUEST_LINEAR_ADDRESS, &gla); -+ npfec.gla_valid = 1; -+ } - else - gla = ~0ull; -- ret = hvm_hap_nested_page_fault(gpa, -- !!(qualification & EPT_GLA_VALID), gla, -- !!(qualification & EPT_READ_VIOLATION), -- !!(qualification & EPT_WRITE_VIOLATION), -- !!(qualification & EPT_EXEC_VIOLATION)); -+ -+ ret = hvm_hap_nested_page_fault(gpa, gla, npfec); - switch ( ret ) - { - case 0: // Unhandled L1 EPT violation ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c -@@ -1261,9 +1261,9 @@ void p2m_mem_paging_resume(struct domain - } - } - --bool_t p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla, -- bool_t access_r, bool_t access_w, bool_t access_x, -- mem_event_request_t **req_ptr) -+bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla, -+ struct npfec npfec, -+ mem_event_request_t **req_ptr) - { - struct vcpu *v = current; - unsigned long gfn = gpa >> PAGE_SHIFT; -@@ -1281,7 +1281,7 @@ bool_t p2m_mem_access_check(paddr_t gpa, - gfn_lock(p2m, gfn, 0); - mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL); - -- if ( access_w && p2ma == p2m_access_rx2rw ) -+ if ( npfec.write_access && p2ma == p2m_access_rx2rw ) - { - rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2mt, p2m_access_rw); - ASSERT(rc); -@@ -1290,7 +1290,7 @@ bool_t p2m_mem_access_check(paddr_t gpa, - } - else if ( p2ma == p2m_access_n2rwx ) - { -- ASSERT(access_w || access_r || access_x); -+ ASSERT(npfec.write_access || npfec.read_access || npfec.insn_fetch); - rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, - p2mt, p2m_access_rwx); - ASSERT(rc); -@@ -1341,11 +1341,11 @@ bool_t p2m_mem_access_check(paddr_t gpa, - /* Send request to mem event */ - req->gfn = gfn; - req->offset = gpa & ((1 << PAGE_SHIFT) - 1); -- req->gla_valid = gla_valid; -+ req->gla_valid = npfec.gla_valid; - req->gla = gla; -- req->access_r = access_r; -- req->access_w = access_w; -- req->access_x = access_x; -+ req->access_r = npfec.read_access; -+ req->access_w = npfec.write_access; -+ req->access_x = npfec.insn_fetch; - - req->vcpu_id = v->vcpu_id; - } ---- a/xen/include/asm-x86/hvm/hvm.h -+++ b/xen/include/asm-x86/hvm/hvm.h -@@ -435,11 +435,8 @@ static inline void hvm_invalidate_regs_f - #endif - } - --int hvm_hap_nested_page_fault(paddr_t gpa, -- bool_t gla_valid, unsigned long gla, -- bool_t access_r, -- bool_t access_w, -- bool_t access_x); -+int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla, -+ struct npfec npfec); - - #define hvm_msr_tsc_aux(v) ({ \ - struct domain *__d = (v)->domain; \ ---- a/xen/include/asm-x86/mm.h -+++ b/xen/include/asm-x86/mm.h -@@ -551,6 +551,16 @@ void audit_domains(void); - - #endif - -+/* -+ * Nested page fault exception codes. -+ */ -+struct npfec { -+ unsigned int read_access:1; -+ unsigned int write_access:1; -+ unsigned int insn_fetch:1; -+ unsigned int gla_valid:1; -+}; -+ - int new_guest_cr3(unsigned long pfn); - void make_cr3(struct vcpu *v, unsigned long mfn); - void update_cr3(struct vcpu *v); ---- a/xen/include/asm-x86/p2m.h -+++ b/xen/include/asm-x86/p2m.h -@@ -568,9 +568,9 @@ void p2m_mem_paging_resume(struct domain - * been promoted with no underlying vcpu pause. If the req_ptr has been populated, - * then the caller must put the event in the ring (once having released get_gfn* - * locks -- caller must also xfree the request. */ --bool_t p2m_mem_access_check(paddr_t gpa, bool_t gla_valid, unsigned long gla, -- bool_t access_r, bool_t access_w, bool_t access_x, -- mem_event_request_t **req_ptr); -+bool_t p2m_mem_access_check(paddr_t gpa, unsigned long gla, -+ struct npfec npfec, -+ mem_event_request_t **req_ptr); - /* Resumes the running of the VCPU, restarting the last instruction */ - void p2m_mem_access_resume(struct domain *d); - diff --git a/53ff36ae-x86-hvm-treat-non-insn-fetch-NPF-also-as-read-violations.patch b/53ff36ae-x86-hvm-treat-non-insn-fetch-NPF-also-as-read-violations.patch deleted file mode 100644 index 9ed5b94..0000000 --- a/53ff36ae-x86-hvm-treat-non-insn-fetch-NPF-also-as-read-violations.patch +++ /dev/null @@ -1,69 +0,0 @@ -References: bnc#882089 - -# Commit 401d5c5cc5a780cad160aa0e3c282c11ac11dd0c -# Date 2014-08-28 16:03:26 +0200 -# Author Tamas K Lengyel -# Committer Jan Beulich -x86/hvm: treat non-instruction fetch nested page faults also as read violations - -As pointed out by Jan Beulich in -http://lists.xen.org/archives/html/xen-devel/2014-08/msg01269.html: -"Read-modify-write instructions absolutely need to be treated as read -accesses, yet hardware doesn't guarantee to tell us so (they may -surface as just write accesses)." This patch addresses the issue in -both the VMX and the SVM side. - -VMX: Treat all write data access violations also as read violations (in - addition to those that were already reported as read violations). -SVM: Refine the meaning of read data access violations to distinguish - between read/write and instruction fetch access violations. - -With this patch both VMX and SVM specific nested page fault handling code reports violations the same way, thus abstracting the hardware specific behaviour from the layers above. - -Suggested-by: Jan Beulich -Signed-off-by: Tamas K Lengyel -Reviewed-by: Boris Ostrovsky -Reviewed-by: Tim Deegan - ---- a/xen/arch/x86/hvm/svm/svm.c -+++ b/xen/arch/x86/hvm/svm/svm.c -@@ -1298,8 +1298,13 @@ static void svm_do_nested_pgfault(struct - p2m_access_t p2ma; - struct p2m_domain *p2m = NULL; - -+ /* -+ * Since HW doesn't explicitly provide a read access bit and we need to -+ * somehow describe read-modify-write instructions we will conservatively -+ * set read_access for all memory accesses that are not instruction fetches. -+ */ - struct npfec npfec = { -- .read_access = 1, /* All NPFs count as reads */ -+ .read_access = !(pfec & PFEC_insn_fetch), - .write_access = !!(pfec & PFEC_write_access), - .insn_fetch = !!(pfec & PFEC_insn_fetch) - }; ---- a/xen/arch/x86/hvm/vmx/vmx.c -+++ b/xen/arch/x86/hvm/vmx/vmx.c -@@ -2278,8 +2278,21 @@ static void ept_handle_violation(unsigne - p2m_type_t p2mt; - int ret; - struct domain *d = current->domain; -+ -+ /* -+ * We treat all write violations also as read violations. -+ * The reason why this is required is the following warning: -+ * "An EPT violation that occurs during as a result of execution of a -+ * read-modify-write operation sets bit 1 (data write). Whether it also -+ * sets bit 0 (data read) is implementation-specific and, for a given -+ * implementation, may differ for different kinds of read-modify-write -+ * operations." -+ * - Intel(R) 64 and IA-32 Architectures Software Developer's Manual -+ * Volume 3C: System Programming Guide, Part 3 -+ */ - struct npfec npfec = { -- .read_access = !!(qualification & EPT_READ_VIOLATION), -+ .read_access = !!(qualification & EPT_READ_VIOLATION) || -+ !!(qualification & EPT_WRITE_VIOLATION), - .write_access = !!(qualification & EPT_WRITE_VIOLATION), - .insn_fetch = !!(qualification & EPT_EXEC_VIOLATION) - }; diff --git a/53ff36d5-x86-mem_event-deliver-gla-fault-EPT-violation-information.patch b/53ff36d5-x86-mem_event-deliver-gla-fault-EPT-violation-information.patch deleted file mode 100644 index 8e18e60..0000000 --- a/53ff36d5-x86-mem_event-deliver-gla-fault-EPT-violation-information.patch +++ /dev/null @@ -1,133 +0,0 @@ -References: bnc#882089 - -# Commit 692f3cc7dd05b80dbd027e46372b1c25d7975332 -# Date 2014-08-28 16:04:05 +0200 -# Author Tamas K Lengyel -# Committer Jan Beulich -x86/mem_event: deliver gla fault EPT violation information - -On Intel EPT the exit qualification generated by a violation also -includes a bit (EPT_GLA_FAULT) which describes the following -information: Set if the access causing the EPT violation is to a -guest-physical address that is the translation of a linear address. -Clear if the access causing the EPT violation is to a paging-structure -entry as part of a page walk or the update of an accessed or dirty bit. - -For more information see Table 27-7 in the Intel SDM. - -This patch extends the mem_event system to deliver this extra -information, which could be useful for determining the cause of a -violation. - -Signed-off-by: Tamas K Lengyel -Reviewed-by: Jan Beulich -Acked-by: Kevin Tian -Acked-by: Tim Deegan - ---- a/xen/arch/x86/hvm/svm/svm.c -+++ b/xen/arch/x86/hvm/svm/svm.c -@@ -1289,7 +1289,7 @@ const struct hvm_function_table * __init - } - - static void svm_do_nested_pgfault(struct vcpu *v, -- struct cpu_user_regs *regs, uint32_t pfec, paddr_t gpa) -+ struct cpu_user_regs *regs, uint64_t pfec, paddr_t gpa) - { - int ret; - unsigned long gfn = gpa >> PAGE_SHIFT; -@@ -1309,6 +1309,12 @@ static void svm_do_nested_pgfault(struct - .insn_fetch = !!(pfec & PFEC_insn_fetch) - }; - -+ /* These bits are mutually exclusive */ -+ if ( pfec & NPT_PFEC_with_gla ) -+ npfec.kind = npfec_kind_with_gla; -+ else if ( pfec & NPT_PFEC_in_gpt ) -+ npfec.kind = npfec_kind_in_gpt; -+ - ret = hvm_hap_nested_page_fault(gpa, ~0ul, npfec); - - if ( tb_init_done ) ---- a/xen/arch/x86/hvm/vmx/vmx.c -+++ b/xen/arch/x86/hvm/vmx/vmx.c -@@ -2317,6 +2317,10 @@ static void ept_handle_violation(unsigne - { - __vmread(GUEST_LINEAR_ADDRESS, &gla); - npfec.gla_valid = 1; -+ if( qualification & EPT_GLA_FAULT ) -+ npfec.kind = npfec_kind_with_gla; -+ else -+ npfec.kind = npfec_kind_in_gpt; - } - else - gla = ~0ull; ---- a/xen/arch/x86/mm/p2m.c -+++ b/xen/arch/x86/mm/p2m.c -@@ -1343,10 +1343,13 @@ bool_t p2m_mem_access_check(paddr_t gpa, - req->offset = gpa & ((1 << PAGE_SHIFT) - 1); - req->gla_valid = npfec.gla_valid; - req->gla = gla; -+ if ( npfec.kind == npfec_kind_with_gla ) -+ req->fault_with_gla = 1; -+ else if ( npfec.kind == npfec_kind_in_gpt ) -+ req->fault_in_gpt = 1; - req->access_r = npfec.read_access; - req->access_w = npfec.write_access; - req->access_x = npfec.insn_fetch; -- - req->vcpu_id = v->vcpu_id; - } - ---- a/xen/include/asm-x86/hvm/svm/svm.h -+++ b/xen/include/asm-x86/hvm/svm/svm.h -@@ -105,4 +105,10 @@ extern u32 svm_feature_flags; - extern void svm_host_osvw_reset(void); - extern void svm_host_osvw_init(void); - -+/* EXITINFO1 fields on NPT faults */ -+#define _NPT_PFEC_with_gla 32 -+#define NPT_PFEC_with_gla (1UL<<_NPT_PFEC_with_gla) -+#define _NPT_PFEC_in_gpt 33 -+#define NPT_PFEC_in_gpt (1UL<<_NPT_PFEC_in_gpt) -+ - #endif /* __ASM_X86_HVM_SVM_H__ */ ---- a/xen/include/asm-x86/mm.h -+++ b/xen/include/asm-x86/mm.h -@@ -552,6 +552,16 @@ void audit_domains(void); - #endif - - /* -+ * Extra fault info types which are used to further describe -+ * the source of an access violation. -+ */ -+typedef enum { -+ npfec_kind_unknown, /* must be first */ -+ npfec_kind_in_gpt, /* violation in guest page table */ -+ npfec_kind_with_gla /* violation with guest linear address */ -+} npfec_kind_t; -+ -+/* - * Nested page fault exception codes. - */ - struct npfec { -@@ -559,6 +569,7 @@ struct npfec { - unsigned int write_access:1; - unsigned int insn_fetch:1; - unsigned int gla_valid:1; -+ unsigned int kind:2; /* npfec_kind_t */ - }; - - int new_guest_cr3(unsigned long pfn); ---- a/xen/include/public/mem_event.h -+++ b/xen/include/public/mem_event.h -@@ -62,7 +62,9 @@ typedef struct mem_event_st { - uint16_t access_w:1; - uint16_t access_x:1; - uint16_t gla_valid:1; -- uint16_t available:12; -+ uint16_t fault_with_gla:1; -+ uint16_t fault_in_gpt:1; -+ uint16_t available:10; - - uint16_t reason; - } mem_event_request_t, mem_event_response_t; diff --git a/53ff3716-x86-ats-Disable-Address-Translation-Services-by-default.patch b/53ff3716-x86-ats-Disable-Address-Translation-Services-by-default.patch deleted file mode 100644 index 4281d26..0000000 --- a/53ff3716-x86-ats-Disable-Address-Translation-Services-by-default.patch +++ /dev/null @@ -1,49 +0,0 @@ -# Commit ad6eddb742577d182e634785bcfaf92732a50024 -# Date 2014-08-28 16:05:10 +0200 -# Author Andrew Cooper -# Committer Jan Beulich -x86/ats: Disable Address Translation Services by default - -Xen cannot safely use any ATS functionality until it gains asynchronous queued -invalidation support, because of the current synchronous wait for completion. - -Do not turn ATS on by default. - -While editing the default in the command line documentation, correct the -statement regarding PCI Passthrough. ATS is purely a performance -optimisation, and is certainly not required for PCI Passthrough to function. - -Signed-off-by: Andrew Cooper -Reviewed-by: Jan Beulich -Acked-by: Suravee Suthikulpanit - ---- a/docs/misc/xen-command-line.markdown -+++ b/docs/misc/xen-command-line.markdown -@@ -167,10 +167,13 @@ developers wishing Xen to fall back to o - ### ats - > `= ` - --> Default: `true` -+> Default: `false` -+ -+Permits Xen to set up and use PCI Address Translation Services. This is a -+performance optimisation for PCI Passthrough. - --Permits Xen to set up and use PCI Address Translation Services, which --is required for PCI Passthrough. -+**WARNING: Xen cannot currently safely use ATS because of its synchronous wait -+loops for Queued Invalidation completions.** - - ### availmem - > `= ` ---- a/xen/drivers/passthrough/x86/ats.c -+++ b/xen/drivers/passthrough/x86/ats.c -@@ -20,7 +20,7 @@ - - LIST_HEAD(ats_devices); - --bool_t __read_mostly ats_enabled = 1; -+bool_t __read_mostly ats_enabled = 0; - boolean_param("ats", ats_enabled); - - int enable_ats_device(int seg, int bus, int devfn, const void *iommu) diff --git a/53ff3899-x86-NMI-allow-processing-unknown-NMIs-with-watchdog.patch b/53ff3899-x86-NMI-allow-processing-unknown-NMIs-with-watchdog.patch deleted file mode 100644 index bea3784..0000000 --- a/53ff3899-x86-NMI-allow-processing-unknown-NMIs-with-watchdog.patch +++ /dev/null @@ -1,220 +0,0 @@ -# Commit 3ea2ba980afe7356c613c8e1ba00d223d1c25412 -# Date 2014-08-28 16:11:37 +0200 -# Author Ross Lagerwall -# Committer Jan Beulich -x86/NMI: allow processing unknown NMIs when watchdog is enabled - -Change NMI processing so that if watchdog=force is passed on the -command-line and the NMI is not caused by a perf counter overflow (i.e. -likely not a watchdog "tick"), the NMI is handled by the unknown NMI -handler. - -This allows injection of NMIs from IPMI controllers that don't set the -IOCK/SERR bits to trigger the unknown NMI handler rather than be -ignored. - -Signed-off-by: Ross Lagerwall -Reviewed-by: Andrew Cooper - -Fix command line parsing (don't enable the watchdog on e.g. -"watchdog=xyz"). - -Signed-off-by: Jan Beulich - -# Commit fd553ae5f0f57baa63d033bedee84f607de57d33 -# Date 2014-09-03 15:09:59 +0200 -# Author Jan Beulich -# Committer Jan Beulich -x86/NMI: allow passing just "watchdog" again - -This capability got inadvertently lost in commit 3ea2ba980a ("x86/NMI: -allow processing unknown NMIs when watchdog is enabled") due to an -oversight of mine. - -Reported-by: Ross Lagerwall -Signed-off-by: Jan Beulich -Reviewed-by: Andrew Cooper - ---- a/docs/misc/xen-command-line.markdown -+++ b/docs/misc/xen-command-line.markdown -@@ -1039,12 +1039,14 @@ As the BTS virtualisation is not 100% sa - don't use the vpmu flag on production systems with Intel cpus! - - ### watchdog --> `= ` -+> `= force | ` - - > Default: `false` - - Run an NMI watchdog on each processor. If a processor is stuck for --longer than the **watchdog\_timeout**, a panic occurs. -+longer than the **watchdog\_timeout**, a panic occurs. When `force` is -+specified, in addition to running an NMI watchdog on each processor, -+unknown NMIs will still be processed. - - ### watchdog\_timeout - > `= ` ---- a/xen/arch/x86/nmi.c -+++ b/xen/arch/x86/nmi.c -@@ -43,7 +43,32 @@ static DEFINE_PER_CPU(unsigned int, nmi_ - - /* opt_watchdog: If true, run a watchdog NMI on each processor. */ - bool_t __initdata opt_watchdog = 0; --boolean_param("watchdog", opt_watchdog); -+ -+/* watchdog_force: If true, process unknown NMIs when running the watchdog. */ -+bool_t watchdog_force = 0; -+ -+static void __init parse_watchdog(char *s) -+{ -+ if ( !*s ) -+ { -+ opt_watchdog = 1; -+ return; -+ } -+ -+ switch ( parse_bool(s) ) -+ { -+ case 0: -+ opt_watchdog = 0; -+ return; -+ case 1: -+ opt_watchdog = 1; -+ return; -+ } -+ -+ if ( !strcmp(s, "force") ) -+ watchdog_force = opt_watchdog = 1; -+} -+custom_param("watchdog", parse_watchdog); - - /* opt_watchdog_timeout: Number of seconds to wait before panic. */ - static unsigned int opt_watchdog_timeout = 5; -@@ -82,6 +107,7 @@ int nmi_active; - #define K7_EVNTSEL_USR (1 << 16) - #define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING 0x76 - #define K7_NMI_EVENT K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING -+#define K7_EVENT_WIDTH 32 - - #define P6_EVNTSEL0_ENABLE (1 << 22) - #define P6_EVNTSEL_INT (1 << 20) -@@ -89,10 +115,12 @@ int nmi_active; - #define P6_EVNTSEL_USR (1 << 16) - #define P6_EVENT_CPU_CLOCKS_NOT_HALTED 0x79 - #define CORE_EVENT_CPU_CLOCKS_NOT_HALTED 0x3c -+#define P6_EVENT_WIDTH 32 - - #define P4_ESCR_EVENT_SELECT(N) ((N)<<25) - #define P4_CCCR_OVF_PMI0 (1<<26) - #define P4_CCCR_OVF_PMI1 (1<<27) -+#define P4_CCCR_OVF (1<<31) - #define P4_CCCR_THRESHOLD(N) ((N)<<20) - #define P4_CCCR_COMPLEMENT (1<<19) - #define P4_CCCR_COMPARE (1<<18) -@@ -433,8 +461,10 @@ int __init watchdog_setup(void) - return 0; - } - --void nmi_watchdog_tick(struct cpu_user_regs * regs) -+/* Returns false if this was not a watchdog NMI, true otherwise */ -+bool_t nmi_watchdog_tick(struct cpu_user_regs *regs) - { -+ bool_t watchdog_tick = 1; - unsigned int sum = this_cpu(nmi_timer_ticks); - - if ( (this_cpu(last_irq_sums) == sum) && watchdog_enabled() ) -@@ -460,8 +490,15 @@ void nmi_watchdog_tick(struct cpu_user_r - - if ( nmi_perfctr_msr ) - { -+ uint64_t msr_content; -+ -+ /* Work out if this is a watchdog tick by checking for overflow. */ - if ( nmi_perfctr_msr == MSR_P4_IQ_PERFCTR0 ) - { -+ rdmsrl(MSR_P4_IQ_CCCR0, msr_content); -+ if ( !(msr_content & P4_CCCR_OVF) ) -+ watchdog_tick = 0; -+ - /* - * P4 quirks: - * - An overflown perfctr will assert its interrupt -@@ -474,14 +511,26 @@ void nmi_watchdog_tick(struct cpu_user_r - } - else if ( nmi_perfctr_msr == MSR_P6_PERFCTR0 ) - { -+ rdmsrl(MSR_P6_PERFCTR0, msr_content); -+ if ( msr_content & (1ULL << P6_EVENT_WIDTH) ) -+ watchdog_tick = 0; -+ - /* - * Only P6 based Pentium M need to re-unmask the apic vector but - * it doesn't hurt other P6 variants. - */ - apic_write(APIC_LVTPC, APIC_DM_NMI); - } -+ else if ( nmi_perfctr_msr == MSR_K7_PERFCTR0 ) -+ { -+ rdmsrl(MSR_K7_PERFCTR0, msr_content); -+ if ( msr_content & (1ULL << K7_EVENT_WIDTH) ) -+ watchdog_tick = 0; -+ } - write_watchdog_counter(NULL); - } -+ -+ return watchdog_tick; - } - - /* ---- a/xen/arch/x86/traps.c -+++ b/xen/arch/x86/traps.c -@@ -3226,14 +3226,15 @@ void do_nmi(struct cpu_user_regs *regs) - { - unsigned int cpu = smp_processor_id(); - unsigned char reason; -+ bool_t handle_unknown = 0; - - ++nmi_count(cpu); - - if ( nmi_callback(regs, cpu) ) - return; - -- if ( nmi_watchdog ) -- nmi_watchdog_tick(regs); -+ if ( !nmi_watchdog || (!nmi_watchdog_tick(regs) && watchdog_force) ) -+ handle_unknown = 1; - - /* Only the BSP gets external NMIs from the system. */ - if ( cpu == 0 ) -@@ -3243,7 +3244,7 @@ void do_nmi(struct cpu_user_regs *regs) - pci_serr_error(regs); - if ( reason & 0x40 ) - io_check_error(regs); -- if ( !(reason & 0xc0) && !nmi_watchdog ) -+ if ( !(reason & 0xc0) && handle_unknown ) - unknown_nmi_error(regs, reason); - } - } ---- a/xen/include/asm-x86/apic.h -+++ b/xen/include/asm-x86/apic.h -@@ -206,7 +206,7 @@ extern void release_lapic_nmi(void); - extern void self_nmi(void); - extern void disable_timer_nmi_watchdog(void); - extern void enable_timer_nmi_watchdog(void); --extern void nmi_watchdog_tick (struct cpu_user_regs *regs); -+extern bool_t nmi_watchdog_tick (struct cpu_user_regs *regs); - extern int APIC_init_uniprocessor (void); - extern void disable_APIC_timer(void); - extern void enable_APIC_timer(void); ---- a/xen/include/asm-x86/nmi.h -+++ b/xen/include/asm-x86/nmi.h -@@ -8,6 +8,9 @@ struct cpu_user_regs; - - /* Watchdog boolean from the command line */ - extern bool_t opt_watchdog; -+ -+/* Watchdog force parameter from the command line */ -+extern bool_t watchdog_force; - - typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu); - diff --git a/54005472-EPT-utilize-GLA-GPA-translation-known-for-certain-faults.patch b/54005472-EPT-utilize-GLA-GPA-translation-known-for-certain-faults.patch deleted file mode 100644 index 951608a..0000000 --- a/54005472-EPT-utilize-GLA-GPA-translation-known-for-certain-faults.patch +++ /dev/null @@ -1,163 +0,0 @@ -References: bnc#882089 - -# Commit ecb69533582e51999e5d76bce513be870222908f -# Date 2014-08-29 12:22:42 +0200 -# Author Jan Beulich -# Committer Jan Beulich -EPT: utilize GLA->GPA translation known for certain faults - -Rather than doing the translation ourselves in __hvmemul_{read,write}() -leverage that we know the association for faults other than such having -occurred when translating addresses of page tables. - -There is one intentional but not necessarily obvious (and possibly -subtle) adjustment to behavior: __hvmemul_read() no longer blindly -bails on instruction fetches matching the MMIO GVA (the callers of -handle_mmio_with_translation() now control the behavior via the struct -npfec they pass, and it didn't seem right to bail here rather than just -falling through to the unaccelerated path) - -Signed-off-by: Jan Beulich -Reviewed-by: Tim Deegan - ---- a/xen/arch/x86/hvm/emulate.c -+++ b/xen/arch/x86/hvm/emulate.c -@@ -496,10 +496,11 @@ static int __hvmemul_read( - while ( off & (chunk - 1) ) - chunk >>= 1; - -- if ( unlikely(vio->mmio_gva == (addr & PAGE_MASK)) && vio->mmio_gva ) -+ if ( ((access_type != hvm_access_insn_fetch -+ ? vio->mmio_access.read_access -+ : vio->mmio_access.insn_fetch)) && -+ (vio->mmio_gva == (addr & PAGE_MASK)) ) - { -- if ( access_type == hvm_access_insn_fetch ) -- return X86EMUL_UNHANDLEABLE; - gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off); - while ( (off + chunk) <= PAGE_SIZE ) - { -@@ -639,7 +640,8 @@ static int hvmemul_write( - while ( off & (chunk - 1) ) - chunk >>= 1; - -- if ( unlikely(vio->mmio_gva == (addr & PAGE_MASK)) && vio->mmio_gva ) -+ if ( vio->mmio_access.write_access && -+ (vio->mmio_gva == (addr & PAGE_MASK)) ) - { - gpa = (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | off); - while ( (off + chunk) <= PAGE_SIZE ) ---- a/xen/arch/x86/hvm/hvm.c -+++ b/xen/arch/x86/hvm/hvm.c -@@ -1529,7 +1529,7 @@ int hvm_hap_nested_page_fault(paddr_t gp - && is_hvm_vcpu(v) - && hvm_mmio_internal(gpa) ) - { -- if ( !handle_mmio() ) -+ if ( !handle_mmio_with_translation(gla, gpa >> PAGE_SHIFT, npfec) ) - hvm_inject_hw_exception(TRAP_gp_fault, 0); - rc = 1; - goto out; -@@ -1603,7 +1603,7 @@ int hvm_hap_nested_page_fault(paddr_t gp - if ( unlikely(is_pvh_vcpu(v)) ) - goto out; - -- if ( !handle_mmio() ) -+ if ( !handle_mmio_with_translation(gla, gpa >> PAGE_SHIFT, npfec) ) - hvm_inject_hw_exception(TRAP_gp_fault, 0); - rc = 1; - goto out; ---- a/xen/arch/x86/hvm/io.c -+++ b/xen/arch/x86/hvm/io.c -@@ -189,7 +189,7 @@ int handle_mmio(void) - if ( vio->io_state == HVMIO_awaiting_completion ) - vio->io_state = HVMIO_handle_mmio_awaiting_completion; - else -- vio->mmio_gva = 0; -+ vio->mmio_access = (struct npfec){}; - - switch ( rc ) - { -@@ -218,9 +218,14 @@ int handle_mmio(void) - return 1; - } - --int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn) -+int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn, -+ struct npfec access) - { - struct hvm_vcpu_io *vio = ¤t->arch.hvm_vcpu.hvm_io; -+ -+ vio->mmio_access = access.gla_valid && -+ access.kind == npfec_kind_with_gla -+ ? access : (struct npfec){}; - vio->mmio_gva = gva & PAGE_MASK; - vio->mmio_gpfn = gpfn; - return handle_mmio(); ---- a/xen/arch/x86/mm/shadow/multi.c -+++ b/xen/arch/x86/mm/shadow/multi.c -@@ -2839,6 +2839,11 @@ static int sh_page_fault(struct vcpu *v, - p2m_type_t p2mt; - uint32_t rc; - int version; -+ struct npfec access = { -+ .read_access = 1, -+ .gla_valid = 1, -+ .kind = npfec_kind_with_gla -+ }; - #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION - int fast_emul = 0; - #endif -@@ -2849,6 +2854,9 @@ static int sh_page_fault(struct vcpu *v, - - perfc_incr(shadow_fault); - -+ if ( regs->error_code & PFEC_write_access ) -+ access.write_access = 1; -+ - #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION - /* If faulting frame is successfully emulated in last shadow fault - * it's highly likely to reach same emulation action for this frame. -@@ -2950,7 +2958,7 @@ static int sh_page_fault(struct vcpu *v, - SHADOW_PRINTK("fast path mmio %#"PRIpaddr"\n", gpa); - reset_early_unshadow(v); - trace_shadow_gen(TRC_SHADOW_FAST_MMIO, va); -- return (handle_mmio_with_translation(va, gpa >> PAGE_SHIFT) -+ return (handle_mmio_with_translation(va, gpa >> PAGE_SHIFT, access) - ? EXCRET_fault_fixed : 0); - } - else -@@ -3447,7 +3455,7 @@ static int sh_page_fault(struct vcpu *v, - paging_unlock(d); - put_gfn(d, gfn_x(gfn)); - trace_shadow_gen(TRC_SHADOW_MMIO, va); -- return (handle_mmio_with_translation(va, gpa >> PAGE_SHIFT) -+ return (handle_mmio_with_translation(va, gpa >> PAGE_SHIFT, access) - ? EXCRET_fault_fixed : 0); - - not_a_shadow_fault: ---- a/xen/include/asm-x86/hvm/io.h -+++ b/xen/include/asm-x86/hvm/io.h -@@ -119,7 +119,8 @@ static inline void register_buffered_io_ - void send_timeoffset_req(unsigned long timeoff); - void send_invalidate_req(void); - int handle_mmio(void); --int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn); -+int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn, -+ struct npfec); - int handle_pio(uint16_t port, unsigned int size, int dir); - void hvm_interrupt_post(struct vcpu *v, int vector, int type); - void hvm_io_assist(ioreq_t *p); ---- a/xen/include/asm-x86/hvm/vcpu.h -+++ b/xen/include/asm-x86/hvm/vcpu.h -@@ -54,8 +54,9 @@ struct hvm_vcpu_io { - * HVM emulation: - * Virtual address @mmio_gva maps to MMIO physical frame @mmio_gpfn. - * The latter is known to be an MMIO frame (not RAM). -- * This translation is only valid if @mmio_gva is non-zero. -+ * This translation is only valid for accesses as per @mmio_access. - */ -+ struct npfec mmio_access; - unsigned long mmio_gva; - unsigned long mmio_gpfn; - diff --git a/CVE-2013-4540-qemu.patch b/CVE-2013-4540-qemu.patch deleted file mode 100644 index b8e7c62..0000000 --- a/CVE-2013-4540-qemu.patch +++ /dev/null @@ -1,52 +0,0 @@ -References: bnc#864801 - -Subject: zaurus: fix buffer overrun on invalid state load -From: Michael S. Tsirkin mst@redhat.com Thu Apr 3 19:52:13 2014 +0300 -Date: Mon May 5 22:15:02 2014 +0200: -Git: 52f91c3723932f8340fe36c8ec8b18a757c37b2b - -CVE-2013-4540 - -Within scoop_gpio_handler_update, if prev_level has a high bit set, then -we get bit > 16 and that causes a buffer overrun. - -Since prev_level comes from wire indirectly, this can -happen on invalid state load. - -Similarly for gpio_level and gpio_dir. - -To fix, limit to 16 bit. - -Reported-by: Michael S. Tsirkin -Signed-off-by: Michael S. Tsirkin -Reviewed-by: Dr. David Alan Gilbert -Signed-off-by: Juan Quintela - -Index: xen-4.4.1-testing/tools/qemu-xen-dir-remote/hw/gpio/zaurus.c -=================================================================== ---- xen-4.4.1-testing.orig/tools/qemu-xen-dir-remote/hw/gpio/zaurus.c -+++ xen-4.4.1-testing/tools/qemu-xen-dir-remote/hw/gpio/zaurus.c -@@ -203,6 +203,15 @@ static bool is_version_0 (void *opaque, - return version_id == 0; - } - -+static bool vmstate_scoop_validate(void *opaque, int version_id) -+{ -+ ScoopInfo *s = opaque; -+ -+ return !(s->prev_level & 0xffff0000) && -+ !(s->gpio_level & 0xffff0000) && -+ !(s->gpio_dir & 0xffff0000); -+} -+ - static const VMStateDescription vmstate_scoop_regs = { - .name = "scoop", - .version_id = 1, -@@ -215,6 +224,7 @@ static const VMStateDescription vmstate_ - VMSTATE_UINT32(gpio_level, ScoopInfo), - VMSTATE_UINT32(gpio_dir, ScoopInfo), - VMSTATE_UINT32(prev_level, ScoopInfo), -+ VMSTATE_VALIDATE("irq levels are 16 bit", vmstate_scoop_validate), - VMSTATE_UINT16(mcr, ScoopInfo), - VMSTATE_UINT16(cdr, ScoopInfo), - VMSTATE_UINT16(ccr, ScoopInfo), diff --git a/README.SUSE b/README.SUSE index 1a6b231..e8a4386 100644 --- a/README.SUSE +++ b/README.SUSE @@ -601,16 +601,13 @@ use the debug-enabled hypervisor, and/or to prevent automatic rebooting. Grub2 Example: Edit /etc/default/grub and add, GRUB_CMDLINE_XEN_DEFAULT="noreboot loglvl=all guest_loglvl=all" - Edit /etc/grub.d/20_linux_xen file. Look for this line: - while [ "x${xen_list}" != "x" ] ; do - and add *before* the above line something like this: - xen_dbg_list=`readlink -f /boot/xen-dbg.gz` - xen_list="$xen_list $xen_dbg_list" - finally run: - grub2-mkconfig -o /boot/grub2/grub.cfg - On reboot, select "Advanced options for SUSE Linux Enterprise Server 12 - (with Xen hypervisor)" from the grub menu and the Xen hypervisor debug entry - in the submenu. + Edit /boot/grub2/grub.cfg and look for these lines: + multiboot /boot/xen-.gz ... + and replace them with: + multiboot /boot/xen-dbg-.gz' ... Replace with the + appropriate version string contained in the filename. Note that running + grub2-mkconfig -o /boot/grub2/grub.cfg will overwrite all manual changes + made to grub.cfg. Grub1 Example: Edit your menu.lst configuration from something like this: diff --git a/bdrv_open2_flags_2.patch b/bdrv_open2_flags_2.patch index 2266da0..ab56e0d 100644 --- a/bdrv_open2_flags_2.patch +++ b/bdrv_open2_flags_2.patch @@ -1,7 +1,7 @@ -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c =================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c @@ -225,6 +225,7 @@ static int open_disk(struct td_state *s, BlockDriver* drv; char* devname; @@ -19,11 +19,11 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c fprintf(stderr, "Could not open image file %s\n", path); return -ENOMEM; } -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c =================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c -@@ -135,7 +135,8 @@ static void insert_media(void *opaque) +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c +@@ -134,7 +134,8 @@ static void insert_media(void *opaque) else format = &bdrv_raw; @@ -33,7 +33,7 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c #ifdef CONFIG_STUBDOM { char *buf, *backend, *params_path, *params; -@@ -510,7 +511,8 @@ void xenstore_parse_domain_config(int hv +@@ -509,7 +510,8 @@ void xenstore_parse_domain_config(int hv } for (i = 0; i < num; i++) { @@ -43,7 +43,7 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c /* read the backend path */ xenstore_get_backend_path(&bpath, "vbd", danger_path, hvm_domid, e_danger[i]); if (bpath == NULL) -@@ -596,6 +598,17 @@ void xenstore_parse_domain_config(int hv +@@ -595,6 +597,17 @@ void xenstore_parse_domain_config(int hv format = &bdrv_raw; } @@ -61,7 +61,7 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c #if 0 /* Phantom VBDs are disabled because the use of paths * from guest-controlled areas in xenstore is unsafe. -@@ -663,7 +676,7 @@ void xenstore_parse_domain_config(int hv +@@ -662,7 +675,7 @@ void xenstore_parse_domain_config(int hv #ifdef CONFIG_STUBDOM if (pasprintf(&danger_buf, "%s/device/vbd/%s", danger_path, e_danger[i]) == -1) continue; diff --git a/blktap-pv-cdrom.patch b/blktap-pv-cdrom.patch index 7efe756..94b0c27 100644 --- a/blktap-pv-cdrom.patch +++ b/blktap-pv-cdrom.patch @@ -8,10 +8,10 @@ xen/include/public/io/cdromif.h | 122 ++++ 7 files changed, 726 insertions(+), 3 deletions(-) -Index: xen-4.4.0-testing/tools/blktap/drivers/Makefile +Index: xen-4.5.0-testing/tools/blktap/drivers/Makefile =================================================================== ---- xen-4.4.0-testing.orig/tools/blktap/drivers/Makefile -+++ xen-4.4.0-testing/tools/blktap/drivers/Makefile +--- xen-4.5.0-testing.orig/tools/blktap/drivers/Makefile ++++ xen-4.5.0-testing/tools/blktap/drivers/Makefile @@ -32,8 +32,9 @@ AIOLIBS := -laio CFLAGS += $(PTHREAD_CFLAGS) LDFLAGS += $(PTHREAD_LDFLAGS) @@ -32,10 +32,10 @@ Index: xen-4.4.0-testing/tools/blktap/drivers/Makefile BLK-OBJS-y += aes.o BLK-OBJS-y += tapaio.o BLK-OBJS-$(CONFIG_Linux) += blk_linux.o -Index: xen-4.4.0-testing/tools/blktap/drivers/block-cdrom.c +Index: xen-4.5.0-testing/tools/blktap/drivers/block-cdrom.c =================================================================== --- /dev/null -+++ xen-4.4.0-testing/tools/blktap/drivers/block-cdrom.c ++++ xen-4.5.0-testing/tools/blktap/drivers/block-cdrom.c @@ -0,0 +1,568 @@ +/* block-cdrom.c + * @@ -605,10 +605,10 @@ Index: xen-4.4.0-testing/tools/blktap/drivers/block-cdrom.c + .td_get_parent_id = tdcdrom_get_parent_id, + .td_validate_parent = tdcdrom_validate_parent +}; -Index: xen-4.4.0-testing/tools/blktap/drivers/tapdisk.c +Index: xen-4.5.0-testing/tools/blktap/drivers/tapdisk.c =================================================================== ---- xen-4.4.0-testing.orig/tools/blktap/drivers/tapdisk.c -+++ xen-4.4.0-testing/tools/blktap/drivers/tapdisk.c +--- xen-4.5.0-testing.orig/tools/blktap/drivers/tapdisk.c ++++ xen-4.5.0-testing/tools/blktap/drivers/tapdisk.c @@ -735,6 +735,22 @@ static void get_io_request(struct td_sta goto out; } @@ -632,10 +632,10 @@ Index: xen-4.4.0-testing/tools/blktap/drivers/tapdisk.c default: DPRINTF("Unknown block operation\n"); break; -Index: xen-4.4.0-testing/tools/blktap/drivers/tapdisk.h +Index: xen-4.5.0-testing/tools/blktap/drivers/tapdisk.h =================================================================== ---- xen-4.4.0-testing.orig/tools/blktap/drivers/tapdisk.h -+++ xen-4.4.0-testing/tools/blktap/drivers/tapdisk.h +--- xen-4.5.0-testing.orig/tools/blktap/drivers/tapdisk.h ++++ xen-4.5.0-testing/tools/blktap/drivers/tapdisk.h @@ -137,6 +137,9 @@ struct tap_disk { int (*td_get_parent_id) (struct disk_driver *dd, struct disk_id *id); int (*td_validate_parent)(struct disk_driver *dd, @@ -680,10 +680,10 @@ Index: xen-4.4.0-testing/tools/blktap/drivers/tapdisk.h }; typedef struct driver_list_entry { -Index: xen-4.4.0-testing/tools/blktap/lib/blktaplib.h +Index: xen-4.5.0-testing/tools/blktap/lib/blktaplib.h =================================================================== ---- xen-4.4.0-testing.orig/tools/blktap/lib/blktaplib.h -+++ xen-4.4.0-testing/tools/blktap/lib/blktaplib.h +--- xen-4.5.0-testing.orig/tools/blktap/lib/blktaplib.h ++++ xen-4.5.0-testing/tools/blktap/lib/blktaplib.h @@ -219,6 +219,7 @@ typedef struct msg_pid { #define DISK_TYPE_RAM 3 #define DISK_TYPE_QCOW 4 @@ -692,11 +692,11 @@ Index: xen-4.4.0-testing/tools/blktap/lib/blktaplib.h /* xenstore/xenbus: */ #define DOMNAME "Domain-0" -Index: xen-4.4.0-testing/xen/include/public/io/blkif.h +Index: xen-4.5.0-testing/xen/include/public/io/blkif.h =================================================================== ---- xen-4.4.0-testing.orig/xen/include/public/io/blkif.h -+++ xen-4.4.0-testing/xen/include/public/io/blkif.h -@@ -453,7 +453,7 @@ +--- xen-4.5.0-testing.orig/xen/include/public/io/blkif.h ++++ xen-4.5.0-testing/xen/include/public/io/blkif.h +@@ -485,7 +485,7 @@ * Used in SLES sources for device specific command packet * contained within the request. Reserved for that purpose. */ @@ -705,10 +705,10 @@ Index: xen-4.4.0-testing/xen/include/public/io/blkif.h /* * Indicate to the backend device that a region of storage is no longer in * use, and may be discarded at any time without impact to the client. If -Index: xen-4.4.0-testing/xen/include/public/io/cdromif.h +Index: xen-4.5.0-testing/xen/include/public/io/cdromif.h =================================================================== --- /dev/null -+++ xen-4.4.0-testing/xen/include/public/io/cdromif.h ++++ xen-4.5.0-testing/xen/include/public/io/cdromif.h @@ -0,0 +1,122 @@ +/****************************************************************************** + * cdromif.h diff --git a/blktap.patch b/blktap.patch index 30aeaeb..a47e6dd 100644 --- a/blktap.patch +++ b/blktap.patch @@ -1,19 +1,6 @@ bug #239173 bug #242953 -Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py -=================================================================== ---- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -3281,7 +3281,7 @@ class XendDomainInfo: - (fn, BOOTLOADER_LOOPBACK_DEVICE)) - - vbd = { -- 'mode': 'RO', -+ 'mode': 'RW', - 'device': BOOTLOADER_LOOPBACK_DEVICE, - } - Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c =================================================================== --- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c diff --git a/block-dmmd b/block-dmmd index c386392..ca0d2dc 100644 --- a/block-dmmd +++ b/block-dmmd @@ -94,16 +94,8 @@ function deactivate_md() function activate_lvm() { local run_timeout=90 - local parsed_timeout local end_time - # Parse device-create-timeout from /etc/xen/xend-config.sxp - # If not set, use default timeout of 90s - parsed_timeout=$(grep -v "^[ \t]*#.*" /etc/xen/xend-config.sxp|sed -n 's/(device-create-timeout \+\([0-9]\+\))/\1/p') - if [ ! -z $parsed_timeout ]; then - run_timeout=$((${parsed_timeout}*9/10)) - fi - end_time=$(($(date +%s)+${run_timeout})) while true; do /sbin/lvchange -aey $1 diff --git a/bridge-bonding.patch b/bridge-bonding.patch deleted file mode 100644 index c4b1112..0000000 --- a/bridge-bonding.patch +++ /dev/null @@ -1,57 +0,0 @@ -Index: xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -=================================================================== ---- xen-4.2.0-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -@@ -251,6 +251,9 @@ op_start () { - - claim_lock "network-bridge" - -+ local bonded="" -+ [ -e /sys/class/net/${netdev}/bonding ] && bonded="yes" -+ - vlans=$(find_active_vlans "${netdev}") - for vlan in $vlans ; do ifdown $vlan ; done - -@@ -268,18 +271,32 @@ op_start () { - ip link set ${netdev} down - ip addr flush ${netdev} - fi -- ip link set ${netdev} name ${pdev} -- ip link set ${tdev} name ${bridge} -- -- setup_physical_bridge_port ${pdev} - -- # Restore slaves -- if [ -n "${slaves}" ]; then -- ip link set ${pdev} up -- ifenslave ${pdev} ${slaves} -+ if [ "x${bonded}" = "xyes" ] -+ then -+ ip link set ${tdev} name ${bridge} -+ ln -sf /etc/sysconfig/network/ifcfg-${netdev} /etc/sysconfig/network/ifcfg-${pdev} -+ ifup ${pdev} -+ local gw=`ip route show dev ${pdev} | fgrep default | sed 's/default via //'` -+ ip addr flush ${pdev} -+ rm -f /etc/sysconfig/network/ifcfg-${pdev} -+ brctl addif ${bridge} ${pdev} -+ ip link set ${bridge} up -+ [ -n "$gw" ] && ip route add default via ${gw} -+ else -+ ip link set ${netdev} name ${pdev} -+ ip link set ${tdev} name ${bridge} -+ -+ _setup_bridge_port ${pdev} -+ -+ # Restore slaves -+ if [ -n "${slaves}" ]; then -+ ip link set ${pdev} up -+ ifenslave ${pdev} ${slaves} -+ fi -+ add_to_bridge2 ${bridge} ${pdev} -+ do_ifup ${bridge} - fi -- add_to_bridge2 ${bridge} ${pdev} -- do_ifup ${bridge} - - for vlan in $vlans ; do ifup $vlan ; done - diff --git a/bridge-opensuse.patch b/bridge-opensuse.patch deleted file mode 100644 index 2a01269..0000000 --- a/bridge-opensuse.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -=================================================================== ---- xen-4.2.0-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -@@ -280,19 +280,19 @@ op_stop () { - transfer_addrs ${bridge} ${pdev} - if ! ifdown ${bridge}; then - get_ip_info ${bridge} -- fi -- ip link set ${pdev} down -- ip addr flush ${bridge} -+ ip link set ${pdev} down -+ ip addr flush ${bridge} - -- brctl delif ${bridge} ${pdev} -- ip link set ${bridge} down -+ brctl delif ${bridge} ${pdev} -+ ip link set ${bridge} down - -- ip link set ${bridge} name ${tdev} -+ ip link set ${bridge} name ${tdev} -+ brctl delbr ${tdev} -+ fi -+ ip link set ${pdev} down - ip link set ${pdev} name ${netdev} - do_ifup ${netdev} - -- brctl delbr ${tdev} -- - release_lock "network-bridge" - } - diff --git a/bridge-record-creation.patch b/bridge-record-creation.patch deleted file mode 100644 index dcac5d4..0000000 --- a/bridge-record-creation.patch +++ /dev/null @@ -1,30 +0,0 @@ -Index: xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -=================================================================== ---- xen-4.2.0-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -@@ -259,6 +259,11 @@ op_start () { - - create_bridge ${tdev} - -+ # Record creation of bridge in /dev/.sysconfig/network/xenbridges so other -+ # tools, e.g. yast2 lan, know that Xen bridging is active. -+ [ -d /dev/.sysconfig/network/xenbridges ] || mkdir /dev/.sysconfig/network/xenbridges -+ touch /dev/.sysconfig/network/xenbridges/${bridge} -+ - preiftransfer ${netdev} - transfer_addrs ${netdev} ${tdev} - # Remember slaves for bonding interface. -@@ -340,6 +345,13 @@ op_stop () { - ip link set ${pdev} name ${netdev} - do_ifup ${netdev} - -+ # Remove record of bridge from /dev/.sysconfig/network/xenbridges ... -+ rm -f /dev/.sysconfig/network/xenbridges/${bridge} -+ # ... and directory itself if empty -+ if [ -z "$(ls -A /dev/.sysconfig/network/xenbridges 2>/dev/null)" ]; then -+ rmdir /dev/.sysconfig/network/xenbridges -+ fi -+ - for vlan in $vlans ; do ifup $vlan ; done - - release_lock "network-bridge" diff --git a/bridge-vlan.patch b/bridge-vlan.patch deleted file mode 100644 index 10df34c..0000000 --- a/bridge-vlan.patch +++ /dev/null @@ -1,71 +0,0 @@ -Index: xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -=================================================================== ---- xen-4.2.0-testing.orig/tools/hotplug/Linux/network-bridge -+++ xen-4.2.0-testing/tools/hotplug/Linux/network-bridge -@@ -195,6 +195,28 @@ antispoofing () { - iptables -A FORWARD -m physdev --physdev-in ${pdev} -j ACCEPT - } - -+find_active_vlans() { -+ local netdev=$1 -+ local vlan -+ local vlans -+ vlans="" -+ for vifcfg in /etc/sysconfig/network/ifcfg-vlan* ; do -+ vlan=${vifcfg/*\/ifcfg-} -+ if [ "$vlan" = "vlan*" ]; then -+ continue -+ fi -+ . $vifcfg -+ etherdevice="$ETHERDEVICE" -+ if [ -x /sbin/getcfg-interface ]; then -+ etherdevice=$(/sbin/getcfg-interface "$ETHERDEVICE") -+ fi -+ if [ "$ETHERDEVICE" = "$netdev" ] || [ "$etherdevice" = "$netdev" ] ; then -+ link_exists "$vlan" && vlans="$vlans $vlan" -+ fi -+ done -+ echo "$vlans" -+} -+ - # Usage: show_status dev bridge - # Print ifconfig and routes. - show_status () { -@@ -229,6 +251,9 @@ op_start () { - - claim_lock "network-bridge" - -+ vlans=$(find_active_vlans "${netdev}") -+ for vlan in $vlans ; do ifdown $vlan ; done -+ - create_bridge ${tdev} - - preiftransfer ${netdev} -@@ -256,6 +281,8 @@ op_start () { - add_to_bridge2 ${bridge} ${pdev} - do_ifup ${bridge} - -+ for vlan in $vlans ; do ifup $vlan ; done -+ - if [ ${antispoof} = 'yes' ] ; then - antispoofing - fi -@@ -277,6 +304,9 @@ op_stop () { - - claim_lock "network-bridge" - -+ vlans=$(find_active_vlans "${netdev}") -+ for vlan in $vlans ; do ifdown $vlan ; done -+ - transfer_addrs ${bridge} ${pdev} - if ! ifdown ${bridge}; then - get_ip_info ${bridge} -@@ -293,6 +323,8 @@ op_stop () { - ip link set ${pdev} name ${netdev} - do_ifup ${netdev} - -+ for vlan in $vlans ; do ifup $vlan ; done -+ - release_lock "network-bridge" - } - diff --git a/build-tapdisk-ioemu.patch b/build-tapdisk-ioemu.patch index b78177f..ff5355e 100644 --- a/build-tapdisk-ioemu.patch +++ b/build-tapdisk-ioemu.patch @@ -8,24 +8,27 @@ resulted in tapdisk-ioemu appearing there, but actually not being built. This patch re-enables the build of tapdisk-ioemu. Signed-off-by: Kevin Wolf ---- - Makefile | 22 +++++++++++++++------- - configure | 2 +- - qemu-tool.c | 2 +- - tapdisk-ioemu.c | 17 ----------------- - 4 files changed, 17 insertions(+), 26 deletions(-) -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/Makefile +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/xen-hooks.mak =================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/Makefile -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/Makefile +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xen-hooks.mak ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/xen-hooks.mak +@@ -1,3 +1,4 @@ ++CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc + CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include + CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include + CPPFLAGS+= -I$(XEN_ROOT)/tools/include +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/Makefile +=================================================================== +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/Makefile ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/Makefile @@ -46,14 +46,6 @@ $(filter %-user,$(SUBDIR_RULES)): libqem recurse-all: $(SUBDIR_RULES) --CPPFLAGS += -I$(XEN_ROOT)/tools/libxc +-CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include -CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib --CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore +-CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore/include -CPPFLAGS += -I$(XEN_ROOT)/tools/include - -tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c @@ -46,9 +49,9 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/Makefile +tapdisk-ioemu.o: tapdisk-ioemu.c + $(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG -DQEMU_TOOL -c -o $@ $< + -+tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc ++tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include +tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib -+tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore ++tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore/include +tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/include +tapdisk-ioemu: tapdisk-ioemu.o $(BLOCK_OBJS) qemu-tool.o hw/tapdisk-xen_blktap.o + $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS) @@ -56,10 +59,10 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/Makefile ###################################################################### # libqemu_common.a: Target independent part of system emulation. The # long term path is to suppress *all* target specific code in case of -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/configure +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/configure =================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/configure -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/configure +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/configure ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/configure @@ -1512,7 +1512,7 @@ bsd) ;; esac @@ -69,10 +72,10 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/configure if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then tools="qemu-img\$(EXESUF) $tools" if [ "$linux" = "yes" ] ; then -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-tool.c +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-tool.c =================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/qemu-tool.c -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-tool.c +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/qemu-tool.c ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-tool.c @@ -68,7 +68,7 @@ void qemu_bh_delete(QEMUBH *bh) qemu_free(bh); } @@ -82,10 +85,10 @@ Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-tool.c IOCanRWHandler *fd_read_poll, IOHandler *fd_read, IOHandler *fd_write, -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/tapdisk-ioemu.c +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/tapdisk-ioemu.c =================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/tapdisk-ioemu.c -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/tapdisk-ioemu.c +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/tapdisk-ioemu.c ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/tapdisk-ioemu.c @@ -12,34 +12,12 @@ extern void qemu_aio_init(void); diff --git a/cdrom-removable.patch b/cdrom-removable.patch index 29648cd..331ed09 100644 --- a/cdrom-removable.patch +++ b/cdrom-removable.patch @@ -1,402 +1,3 @@ -Index: xen-4.4.0-testing/tools/python/xen/xend/server/HalDaemon.py -=================================================================== ---- /dev/null -+++ xen-4.4.0-testing/tools/python/xen/xend/server/HalDaemon.py -@@ -0,0 +1,243 @@ -+#!/usr/bin/env python -+# -*- mode: python; -*- -+#============================================================================ -+# This library is free software; you can redistribute it and/or -+# modify it under the terms of version 2.1 of the GNU Lesser General Public -+# License as published by the Free Software Foundation. -+# -+# This library is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+# Lesser General Public License for more details. -+# -+# You should have received a copy of the GNU Lesser General Public -+# License along with this library; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+#============================================================================ -+# Copyright (C) 2007 Pat Campbell -+# Copyright (C) 2007 Novell Inc. -+#============================================================================ -+ -+"""hald (Hardware Abstraction Layer Daemon) watcher for Xen management -+ of removable block device media. -+ -+""" -+ -+import gobject -+import dbus -+import dbus.glib -+import os -+import types -+import sys -+import signal -+import traceback -+from xen.xend.xenstore.xstransact import xstransact, complete -+from xen.xend.xenstore.xsutil import xshandle -+from xen.xend import PrettyPrint -+from xen.xend import XendLogging -+from xen.xend.XendLogging import log -+ -+DEVICE_TYPES = ['vbd', 'tap'] -+ -+class HalDaemon: -+ """The Hald block device watcher for XEN -+ """ -+ -+ """Default path to the log file. """ -+ logfile_default = "/var/log/xen/hald.log" -+ -+ """Default level of information to be logged.""" -+ loglevel_default = 'INFO' -+ -+ -+ def __init__(self): -+ -+ XendLogging.init(self.logfile_default, self.loglevel_default) -+ log.debug( "%s", "__init__") -+ -+ self.udi_dict = {} -+ self.debug = 0 -+ self.dbpath = "/local/domain/0/backend" -+ self.bus = dbus.SystemBus() -+ self.hal_manager_obj = self.bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager') -+ self.hal_manager = dbus.Interface( self.hal_manager_obj, 'org.freedesktop.Hal.Manager') -+ self.gatherBlockDevices() -+ self.registerDeviceCallbacks() -+ -+ def run(self): -+ log.debug( "%s", "In new run" ); -+ try: -+ self.mainloop = gobject.MainLoop() -+ self.mainloop.run() -+ except KeyboardInterrupt, ex: -+ log.debug('Keyboard exception handler: %s', ex ) -+ self.mainloop.quit() -+ except Exception, ex: -+ log.debug('Generic exception handler: %s', ex ) -+ self.mainloop.quit() -+ -+ def __del__(self): -+ log.debug( "%s", "In del " ); -+ self.unRegisterDeviceCallbacks() -+ self.mainloop.quit() -+ -+ def shutdown(self): -+ log.debug( "%s", "In shutdown now " ); -+ self.unRegisterDeviceCallbacks() -+ self.mainloop.quit() -+ -+ def stop(self): -+ log.debug( "%s", "In stop now " ); -+ self.unRegisterDeviceCallbacks() -+ self.mainloop.quit() -+ -+ def gatherBlockDevices(self): -+ -+ # Get all the current devices from hal and save in a dictionary -+ try: -+ device_names = self.hal_manager.GetAllDevices() -+ i = 0; -+ for name in device_names: -+ #log.debug("device name, device=%s",name) -+ dev_obj = self.bus.get_object ('org.freedesktop.Hal', name) -+ dev = dbus.Interface (dev_obj, 'org.freedesktop.Hal.Device') -+ dev_properties = dev_obj.GetAllProperties(dbus_interface="org.freedesktop.Hal.Device") -+ if dev_properties.has_key('block.device'): -+ dev_str = dev_properties['block.device'] -+ dev_major = dev_properties['block.major'] -+ dev_minor = dev_properties['block.minor'] -+ udi_info = {} -+ udi_info['device'] = dev_str -+ udi_info['major'] = dev_major -+ udi_info['minor'] = dev_minor -+ udi_info['udi'] = name -+ self.udi_dict[i] = udi_info -+ i = i + 1 -+ except Exception, ex: -+ print >>sys.stderr, 'Exception gathering block devices:', ex -+ log.warn("Exception gathering block devices (%s)",ex) -+ -+ # -+ def registerDeviceCallbacks(self): -+ # setup the callbacks for when the gdl changes -+ self.hal_manager.connect_to_signal('DeviceAdded', self.device_added_callback) -+ self.hal_manager.connect_to_signal('DeviceRemoved', self.device_removed_callback) -+ -+ # -+ def unRegisterDeviceCallbacks(self): -+ # setup the callbacks for when the gdl changes -+ self.hal_manager.remove_signal_receiver(self.device_added_callback,'DeviceAdded') -+ self.hal_manager.remove_signal_receiver(self.device_removed_callback,'DeviceRemoved') -+ -+ # -+ def device_removed_callback(self,udi): -+ log.debug('UDI %s was removed',udi) -+ self.show_dict(self.udi_dict) -+ for key in self.udi_dict: -+ udi_info = self.udi_dict[key] -+ if udi_info['udi'] == udi: -+ device = udi_info['device'] -+ major = udi_info['major'] -+ minor = udi_info['minor'] -+ self.change_xenstore( "remove", device, major, minor) -+ -+ # Adds device to dictionary if not already there -+ def device_added_callback(self,udi): -+ log.debug('UDI %s was added', udi) -+ self.show_dict(self.udi_dict) -+ dev_obj = self.bus.get_object ('org.freedesktop.Hal', udi) -+ dev = dbus.Interface (dev_obj, 'org.freedesktop.Hal.Device') -+ device = dev.GetProperty ('block.device') -+ major = dev.GetProperty ('block.major') -+ minor = dev.GetProperty ('block.minor') -+ udi_info = {} -+ udi_info['device'] = device -+ udi_info['major'] = major -+ udi_info['minor'] = minor -+ udi_info['udi'] = udi -+ already = 0 -+ cnt = 0; -+ for key in self.udi_dict: -+ info = self.udi_dict[key] -+ if info['udi'] == udi: -+ already = 1 -+ break -+ cnt = cnt + 1 -+ if already == 0: -+ self.udi_dict[cnt] = udi_info; -+ log.debug('UDI %s was added, device:%s major:%s minor:%s index:%d\n', udi, device, major, minor, cnt) -+ self.change_xenstore( "add", device, major, minor) -+ -+ # Debug helper, shows dictionary contents -+ def show_dict(self,dict=None): -+ if self.debug == 0 : -+ return -+ if dict == None : -+ dict = self.udi_dict -+ for key in dict: -+ log.debug('udi_info %s udi_info:%s',key,dict[key]) -+ -+ # Set or clear xenstore media-present depending on the action argument -+ # for every vbd that has this block device -+ def change_xenstore(self,action, device, major, minor): -+ for type in DEVICE_TYPES: -+ path = self.dbpath + '/' + type -+ domains = xstransact.List(path) -+ log.debug('domains: %s', domains) -+ for domain in domains: # for each domain -+ devices = xstransact.List( path + '/' + domain) -+ log.debug('devices: %s',devices) -+ for device in devices: # for each vbd device -+ str = device.split('/') -+ vbd_type = None; -+ vbd_physical_device = None -+ vbd_media = None -+ vbd_device_path = path + '/' + domain + '/' + device -+ listing = xstransact.List(vbd_device_path) -+ for entry in listing: # for each entry -+ item = path + '/' + entry -+ value = xstransact.Read( vbd_device_path + '/' + entry) -+ log.debug('%s=%s',item,value) -+ if item.find('media-present') != -1: -+ vbd_media = item; -+ vbd_media_path = item -+ if item.find('physical-device') != -1: -+ vbd_physical_device = value; -+ if item.find('type') != -1: -+ vbd_type = value; -+ if vbd_type is not None and vbd_physical_device is not None and vbd_media is not None : -+ inode = vbd_physical_device.split(':') -+ imajor = parse_hex(inode[0]) -+ iminor = parse_hex(inode[1]) -+ log.debug("action:%s major:%s- minor:%s- imajor:%s- iminor:%s- inode: %s", -+ action,major,minor, imajor, iminor, inode) -+ if int(imajor) == int(major) and int(iminor) == int(minor): -+ if action == "add": -+ xs_dict = {'media': "1"} -+ xstransact.Write(vbd_device_path, 'media-present', "1" ) -+ log.debug("wrote xenstore media-present 1 path:%s",vbd_media_path) -+ else: -+ xstransact.Write(vbd_device_path, 'media-present', "0" ) -+ log.debug("wrote xenstore media 0 path:%s",vbd_media_path) -+ -+def mylog( fmt, *args): -+ f = open('/tmp/haldaemon.log', 'a') -+ print >>f, "HalDaemon ", fmt % args -+ f.close() -+ -+ -+def parse_hex(val): -+ try: -+ if isinstance(val, types.StringTypes): -+ return int(val, 16) -+ else: -+ return val -+ except ValueError: -+ return None -+ -+if __name__ == "__main__": -+ watcher = HalDaemon() -+ watcher.run() -+ print 'Falling off end' -+ -+ -Index: xen-4.4.0-testing/tools/python/xen/xend/server/Hald.py -=================================================================== ---- /dev/null -+++ xen-4.4.0-testing/tools/python/xen/xend/server/Hald.py -@@ -0,0 +1,125 @@ -+#============================================================================ -+# This library is free software; you can redistribute it and/or -+# modify it under the terms of version 2.1 of the GNU Lesser General Public -+# License as published by the Free Software Foundation. -+# -+# This library is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+# Lesser General Public License for more details. -+# -+# You should have received a copy of the GNU Lesser General Public -+# License along with this library; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+#============================================================================ -+# Copyright (C) 2007 Pat Campbell -+# Copyright (C) 2007 Novell Inc. -+#============================================================================ -+ -+import errno -+import types -+import os -+import sys -+import time -+import signal -+from traceback import print_exc -+ -+from xen.xend.XendLogging import log -+ -+class Hald: -+ def __init__(self): -+ self.ready = False -+ self.running = True -+ -+ def run(self): -+ """Starts the HalDaemon process -+ """ -+ self.ready = True -+ try: -+ myfile = self.find("xen/xend/server/HalDaemon.py") -+ args = (["python", myfile ]) -+ self.pid = self.daemonize("python", args ) -+ #log.debug( "%s %s pid:%d", "Hald.py starting ", args, self.pid ) -+ except: -+ self.pid = -1 -+ log.debug("Unable to start HalDaemon process") -+ -+ def shutdown(self): -+ """Shutdown the HalDaemon process -+ """ -+ log.debug("%s pid:%d", "Hald.shutdown()", self.pid) -+ self.running = False -+ self.ready = False -+ if self.pid != -1: -+ try: -+ os.kill(self.pid, signal.SIGINT) -+ except: -+ print_exc() -+ -+ def daemonize(self,prog, args): -+ """Runs a program as a daemon with the list of arguments. Returns the PID -+ of the daemonized program, or returns 0 on error. -+ Copied from xm/create.py instead of importing to reduce coupling -+ """ -+ r, w = os.pipe() -+ pid = os.fork() -+ -+ if pid == 0: -+ os.close(r) -+ w = os.fdopen(w, 'w') -+ os.setsid() -+ try: -+ pid2 = os.fork() -+ except: -+ pid2 = None -+ if pid2 == 0: -+ os.chdir("/") -+ env = os.environ.copy() -+ env['PYTHONPATH'] = self.getpythonpath() -+ for fd in range(0, 256): -+ try: -+ os.close(fd) -+ except: -+ pass -+ os.open("/dev/null", os.O_RDWR) -+ os.dup2(0, 1) -+ os.dup2(0, 2) -+ os.execvpe(prog, args, env) -+ os._exit(1) -+ else: -+ w.write(str(pid2 or 0)) -+ w.close() -+ os._exit(0) -+ os.close(w) -+ r = os.fdopen(r) -+ daemon_pid = int(r.read()) -+ r.close() -+ os.waitpid(pid, 0) -+ #log.debug( "daemon_pid: %d", daemon_pid ) -+ return daemon_pid -+ -+ def getpythonpath(self): -+ str = " " -+ for p in sys.path: -+ if str != " ": -+ str = str + ":" + p -+ else: -+ if str != "": -+ str = p -+ return str -+ -+ def find(self,path, matchFunc=os.path.isfile): -+ """Find a module in the sys.path -+ From web page: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52224 -+ """ -+ for dirname in sys.path: -+ candidate = os.path.join(dirname, path) -+ if matchFunc(candidate): -+ return candidate -+ raise Error("Can't find file %s" % path) -+ -+if __name__ == "__main__": -+ watcher = Hald() -+ watcher.run() -+ time.sleep(10) -+ watcher.shutdown() -Index: xen-4.4.0-testing/tools/python/xen/xend/server/SrvServer.py -=================================================================== ---- xen-4.4.0-testing.orig/tools/python/xen/xend/server/SrvServer.py -+++ xen-4.4.0-testing/tools/python/xen/xend/server/SrvServer.py -@@ -57,6 +57,7 @@ from xen.web.SrvDir import SrvDir - - from SrvRoot import SrvRoot - from XMLRPCServer import XMLRPCServer -+from xen.xend.server.Hald import Hald - - xoptions = XendOptions.instance() - -@@ -252,6 +253,8 @@ def _loadConfig(servers, root, reload): - if xoptions.get_xend_unix_xmlrpc_server(): - servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False)) - -+ servers.add(Hald()) -+ - - def create(): - root = SrvDir() Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c =================================================================== --- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c diff --git a/change-vnc-passwd.patch b/change-vnc-passwd.patch deleted file mode 100644 index 7a0c36f..0000000 --- a/change-vnc-passwd.patch +++ /dev/null @@ -1,166 +0,0 @@ -Add support of change-vnc-password while vm is running. - -Signed-off-by: Chunyan Liu - ---- - tools/python/xen/xend/XendDomainInfo.py | 14 ++++++++++++++ - tools/python/xen/xend/server/XMLRPCServer.py | 2 +- - tools/python/xen/xm/main.py | 12 ++++++++++++ - tools/qemu-xen-traditional-dir-remote/vl.c | 2 +- - tools/qemu-xen-traditional-dir-remote/vnc.c | 1 + - tools/qemu-xen-traditional-dir-remote/xenstore.c | 14 ++++++++++++++ - 6 files changed, 43 insertions(+), 2 deletions(-) - -Index: xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py -=================================================================== ---- xen-4.4.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py -+++ xen-4.4.0-testing/tools/python/xen/xend/XendDomainInfo.py -@@ -1665,6 +1665,20 @@ class XendDomainInfo: - vfb_ctrl.reconfigureDevice(0, dev_info) - break - -+ def chgvncpasswd(self, passwd): -+ if self._stateGet() != DOM_STATE_HALTED: -+ path = '/local/domain/0/backend/vfb/%u/0/' % self.getDomid() -+ xstransact.Write(path, 'vncpasswd', passwd) -+ self.image.signalDeviceModel("chgvncpasswd", "vncpasswdchged") -+ -+ for dev_uuid, (dev_type, dev_info) in self.info['devices'].items(): -+ if dev_type == 'vfb': -+ dev_info['vncpasswd'] = passwd -+ dev_info['other_config']['vncpasswd'] = passwd -+ self.info.device_update(dev_uuid, cfg_xenapi = dev_info) -+ break -+ xen.xend.XendDomain.instance().managed_config_save(self) -+ - # - # Function to update xenstore /vm/* - # -Index: xen-4.4.0-testing/tools/python/xen/xend/server/XMLRPCServer.py -=================================================================== ---- xen-4.4.0-testing.orig/tools/python/xen/xend/server/XMLRPCServer.py -+++ xen-4.4.0-testing/tools/python/xen/xend/server/XMLRPCServer.py -@@ -95,7 +95,7 @@ methods = ['device_create', 'device_conf - 'destroyDevice','getDeviceSxprs', - 'setMemoryTarget', 'setName', 'setVCpuCount', 'shutdown', - 'send_sysrq', 'getVCPUInfo', 'waitForDevices', -- 'getRestartCount', 'getBlockDeviceClass'] -+ 'getRestartCount', 'getBlockDeviceClass', 'chgvncpasswd'] - - exclude = ['domain_create', 'domain_restore'] - -Index: xen-4.4.0-testing/tools/python/xen/xm/main.py -=================================================================== ---- xen-4.4.0-testing.orig/tools/python/xen/xm/main.py -+++ xen-4.4.0-testing/tools/python/xen/xm/main.py -@@ -21,6 +21,7 @@ - - """Grand unified management application for Xen. - """ -+import getpass - import atexit - import cmd - import os -@@ -280,6 +281,9 @@ SUBCOMMAND_HELP = { - 'getenforce' : ('', 'Returns the current enforcing mode for the Flask XSM module (Enforcing,Permissive)'), - 'setenforce' : ('[ (Enforcing|1) | (Permissive|0) ]', - 'Modifies the current enforcing mode for the Flask XSM module'), -+ #change vnc password -+ 'change-vnc-passwd' : ('',\ -+ 'Change vnc password'), - } - - SUBCOMMAND_OPTIONS = { -@@ -404,6 +408,7 @@ common_commands = [ - "usb-del", - "domstate", - "vcpu-set", -+ "change-vnc-passwd", - ] - - domain_commands = [ -@@ -441,6 +446,7 @@ domain_commands = [ - "vcpu-list", - "vcpu-pin", - "vcpu-set", -+ "change-vnc-passwd", - ] - - host_commands = [ -@@ -3751,6 +3757,10 @@ def xm_cpupool_migrate(args): - else: - server.xend.cpu_pool.migrate(domname, poolname) - -+def xm_chgvncpasswd(args): -+ arg_check(args, "change-vnc-passwd", 1) -+ pwd = getpass.getpass("Enter new password: ") -+ server.xend.domain.chgvncpasswd(args[0], pwd) - - commands = { - "shell": xm_shell, -@@ -3857,6 +3867,8 @@ commands = { - "usb-del": xm_usb_del, - #domstate - "domstate": xm_domstate, -+ #change vnc password: -+ "change-vnc-passwd": xm_chgvncpasswd, - } - - ## The commands supported by a separate argument parser in xend.xm. -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/vl.c -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c -@@ -200,7 +200,7 @@ DriveInfo drives_table[MAX_DRIVES+1]; - int nb_drives; - enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; - int vga_ram_size; --static DisplayState *display_state; -+DisplayState *display_state; - int nographic; - static int curses; - static int sdl; -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vnc.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/vnc.c -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/vnc.c -@@ -2600,6 +2600,7 @@ int vnc_display_password(DisplayState *d - if (password && password[0]) { - if (!(vs->password = qemu_strdup(password))) - return -1; -+ vs->auth = VNC_AUTH_VNC; - } - - return 0; -Index: xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c -+++ xen-4.4.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c -@@ -25,6 +25,7 @@ - #include "qemu-xen.h" - #include "xen_backend.h" - -+extern DisplayState *display_state; - struct xs_handle *xsh = NULL; - static char *media_filename[MAX_DRIVES+1]; - static QEMUTimer *insert_timer = NULL; -@@ -897,6 +898,19 @@ static void xenstore_process_dm_command_ - } else if (!strncmp(command, "continue", len)) { - fprintf(logfile, "dm-command: continue after state save\n"); - xen_pause_requested = 0; -+ } else if (!strncmp(command, "chgvncpasswd", len)) { -+ fprintf(logfile, "dm-command: change vnc passwd\n"); -+ if (pasprintf(&path, -+ "/local/domain/0/backend/vfb/%u/0/vncpasswd", domid) == -1) { -+ fprintf(logfile, "out of memory reading dm command parameter\n"); -+ goto out; -+ } -+ par = xs_read(xsh, XBT_NULL, path, &len); -+ if (!par) -+ goto out; -+ if (vnc_display_password(display_state, par) == 0) -+ xenstore_record_dm_state("vncpasswdchged"); -+ free(par); - } else if (!strncmp(command, "usb-add", len)) { - fprintf(logfile, "dm-command: usb-add a usb device\n"); - if (pasprintf(&path, diff --git a/disable-wget-check.patch b/disable-wget-check.patch deleted file mode 100644 index 71c315b..0000000 --- a/disable-wget-check.patch +++ /dev/null @@ -1,433 +0,0 @@ -Index: xen-4.4.1-testing/tools/configure -=================================================================== ---- xen-4.4.1-testing.orig/tools/configure -+++ xen-4.4.1-testing/tools/configure -@@ -633,9 +633,6 @@ libgcrypt - EXTFS_LIBS - system_aio - zlib --FETCHER --FTP --WGET - glib_LIBS - glib_CFLAGS - PKG_CONFIG_LIBDIR -@@ -7375,104 +7372,104 @@ $as_echo "yes" >&6; } - fi - - # Extract the first word of "wget", so it can be a program name with args. --set dummy wget; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if ${ac_cv_path_WGET+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- case $WGET in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_WGET="$WGET" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- -- test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no" -- ;; --esac --fi --WGET=$ac_cv_path_WGET --if test -n "$WGET"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 --$as_echo "$WGET" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- --if test x"$WGET" != x"no"; then : -- -- FETCHER="$WGET -c -O" -- --else -- -- # Extract the first word of "ftp", so it can be a program name with args. --set dummy ftp; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if ${ac_cv_path_FTP+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- case $FTP in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_FTP="$FTP" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- -- test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no" -- ;; --esac --fi --FTP=$ac_cv_path_FTP --if test -n "$FTP"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5 --$as_echo "$FTP" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- -- if test x"$FTP" != x"no"; then : -- -- FETCHER="$FTP -o" -- --else -- -- as_fn_error $? "cannot find wget or ftp" "$LINENO" 5 -- --fi -- --fi -+#set dummy wget; ac_word=$2 -+#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+#$as_echo_n "checking for $ac_word... " >&6; } -+#if ${ac_cv_path_WGET+:} false; then : -+# $as_echo_n "(cached) " >&6 -+#else -+# case $WGET in -+# [\\/]* | ?:[\\/]*) -+# ac_cv_path_WGET="$WGET" # Let the user override the test with a path. -+# ;; -+# *) -+# as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+#for as_dir in $PATH -+#do -+# IFS=$as_save_IFS -+# test -z "$as_dir" && as_dir=. -+# for ac_exec_ext in '' $ac_executable_extensions; do -+# if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+# ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" -+# $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+# break 2 -+# fi -+#done -+# done -+#IFS=$as_save_IFS -+# -+# test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no" -+# ;; -+#esac -+#fi -+#WGET=$ac_cv_path_WGET -+#if test -n "$WGET"; then -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 -+#$as_echo "$WGET" >&6; } -+#else -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+#$as_echo "no" >&6; } -+#fi -+# -+# -+#if test x"$WGET" != x"no"; then : -+# -+# FETCHER="$WGET -c -O" -+# -+#else -+# -+# # Extract the first word of "ftp", so it can be a program name with args. -+#set dummy ftp; ac_word=$2 -+#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+#$as_echo_n "checking for $ac_word... " >&6; } -+#if ${ac_cv_path_FTP+:} false; then : -+# $as_echo_n "(cached) " >&6 -+#else -+# case $FTP in -+# [\\/]* | ?:[\\/]*) -+# ac_cv_path_FTP="$FTP" # Let the user override the test with a path. -+# ;; -+# *) -+# as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+#for as_dir in $PATH -+#do -+# IFS=$as_save_IFS -+# test -z "$as_dir" && as_dir=. -+# for ac_exec_ext in '' $ac_executable_extensions; do -+# if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+# ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext" -+# $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+# break 2 -+# fi -+#done -+# done -+#IFS=$as_save_IFS -+# -+# test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no" -+# ;; -+#esac -+#fi -+#FTP=$ac_cv_path_FTP -+#if test -n "$FTP"; then -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5 -+#$as_echo "$FTP" >&6; } -+#else -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+#$as_echo "no" >&6; } -+#fi -+# -+# -+# if test x"$FTP" != x"no"; then : -+# -+# FETCHER="$FTP -o" -+# -+#else -+# -+# as_fn_error $? "cannot find wget or ftp" "$LINENO" 5 -+# -+#fi -+# -+#fi - - - -Index: xen-4.4.1-testing/stubdom/configure -=================================================================== ---- xen-4.4.1-testing.orig/stubdom/configure -+++ xen-4.4.1-testing/stubdom/configure -@@ -623,8 +623,6 @@ LDFLAGS - CFLAGS - CC - FETCHER --FTP --WGET - CMAKE - extfiles - debug -@@ -2300,104 +2298,104 @@ extfiles=$ax_cv_extfiles - - - # Extract the first word of "wget", so it can be a program name with args. --set dummy wget; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if ${ac_cv_path_WGET+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- case $WGET in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_WGET="$WGET" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- -- test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no" -- ;; --esac --fi --WGET=$ac_cv_path_WGET --if test -n "$WGET"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 --$as_echo "$WGET" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- --if test x"$WGET" != x"no"; then : -- -- FETCHER="$WGET -c -O" -- --else -- -- # Extract the first word of "ftp", so it can be a program name with args. --set dummy ftp; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if ${ac_cv_path_FTP+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- case $FTP in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_FTP="$FTP" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -- ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- -- test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no" -- ;; --esac --fi --FTP=$ac_cv_path_FTP --if test -n "$FTP"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5 --$as_echo "$FTP" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- -- if test x"$FTP" != x"no"; then : -- -- FETCHER="$FTP -o" -- --else -- -- as_fn_error $? "cannot find wget or ftp" "$LINENO" 5 -- --fi -- --fi -+#set dummy wget; ac_word=$2 -+#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+#$as_echo_n "checking for $ac_word... " >&6; } -+#if ${ac_cv_path_WGET+:} false; then : -+# $as_echo_n "(cached) " >&6 -+#else -+# case $WGET in -+# [\\/]* | ?:[\\/]*) -+# ac_cv_path_WGET="$WGET" # Let the user override the test with a path. -+# ;; -+# *) -+# as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+#for as_dir in $PATH -+#do -+# IFS=$as_save_IFS -+# test -z "$as_dir" && as_dir=. -+# for ac_exec_ext in '' $ac_executable_extensions; do -+# if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+# ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" -+# $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+# break 2 -+# fi -+#done -+# done -+#IFS=$as_save_IFS -+# -+# test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="no" -+# ;; -+#esac -+#fi -+#WGET=$ac_cv_path_WGET -+#if test -n "$WGET"; then -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 -+#$as_echo "$WGET" >&6; } -+#else -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+#$as_echo "no" >&6; } -+#fi -+# -+# -+#if test x"$WGET" != x"no"; then : -+# -+# FETCHER="$WGET -c -O" -+# -+#else -+# -+# # Extract the first word of "ftp", so it can be a program name with args. -+#set dummy ftp; ac_word=$2 -+#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+#$as_echo_n "checking for $ac_word... " >&6; } -+#if ${ac_cv_path_FTP+:} false; then : -+# $as_echo_n "(cached) " >&6 -+#else -+# case $FTP in -+# [\\/]* | ?:[\\/]*) -+# ac_cv_path_FTP="$FTP" # Let the user override the test with a path. -+# ;; -+# *) -+# as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+#for as_dir in $PATH -+#do -+# IFS=$as_save_IFS -+# test -z "$as_dir" && as_dir=. -+# for ac_exec_ext in '' $ac_executable_extensions; do -+# if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+# ac_cv_path_FTP="$as_dir/$ac_word$ac_exec_ext" -+# $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+# break 2 -+# fi -+#done -+# done -+#IFS=$as_save_IFS -+# -+# test -z "$ac_cv_path_FTP" && ac_cv_path_FTP="no" -+# ;; -+#esac -+#fi -+#FTP=$ac_cv_path_FTP -+#if test -n "$FTP"; then -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5 -+#$as_echo "$FTP" >&6; } -+#else -+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+#$as_echo "no" >&6; } -+#fi -+# -+# -+# if test x"$FTP" != x"no"; then : -+# -+# FETCHER="$FTP -o" -+# -+#else -+# -+# as_fn_error $? "cannot find wget or ftp" "$LINENO" 5 -+# -+#fi -+# -+#fi - - - diff --git a/domUloader.py b/domUloader.py deleted file mode 100644 index f8ea760..0000000 --- a/domUloader.py +++ /dev/null @@ -1,553 +0,0 @@ -#!/usr/bin/env python -# domUloader.py -"""Loader for kernel and (optional) ramdisk from domU filesystem - -Given a physical disk (or disk image) for a domU and the path of a kernel and -optional ramdisk, copies the kernel and ramdisk from the domU disk to a -temporary location in dom0. - -The --entry parameter specifies the location of the kernel (and optional -ramdisk) within the domU filesystem. dev is the disk as seen by domU. -Filenames are relative to that filesystem. - -The disk is passed as the last parameter. It must be a block device or raw -disk image. More complex disk images (QCOW, VMDK, etc) must already be -configured via blktap and presented as a block device. - -The script writes an sxpr specifying the locations of the copied kernel and -ramdisk into the file specified by --output (default is stdout). - -Limitations: - - It is assumed both kernel and ramdisk are on the same filesystem. - - domUs might use LVM; the script currently does not have support for setting - up LVM mappings for domUs; it's not trivial and we might risk namespace - conflicts. If you want to use LVM inside domUs, set up a small non-LVM boot - partition and specify it in bootentry. - -The script uses kpartx (multipath-tools) to create mappings for devices that -are exported as whole disk devices that are partitioned. - -(c) 01/2006 Novell Inc -License: GNU GPL -Author: Kurt Garloff -""" - -import os, sys, getopt -from stat import * -from xen.xend import sxp -import tempfile -import time -import xnloader - -# Global options -quiet = False -verbose = False -dryrun = False -tmpdir = '/var/lib/xen/tmp' -in_args = '' -# kpartx, left to its own devices, does not consistently pick the -# same partition separator. Explicitly specify it. -kpartx_args = '-p -part' - -# Helper functions - -def kpartx_has_opt(opt): - """ Return True if kpartx supports option opt, otherwise False""" - have_opt = True - kpartx_cmd = 'kpartx -' + opt + ' 2>&1' - p = os.popen(kpartx_cmd) - for line in p.readlines(): - if line.find('invalid option') >= 0: - have_opt = False - break - p.close() - return have_opt - -def error(s): - print >> sys.stderr, "domUloader error: %s" % s - -def verbose_print(s): - if verbose: - print >> sys.stderr, "domUloader: %s" % s - -def traildigits(strg): - """Return the trailing digits, used to split the partition number off""" - idx = len(strg)-1 - while strg[idx].isdigit(): - if len == 0: - return strg - idx -= 1 - return strg[idx+1:] - -def getWholedisk(part): - while len(part) and part[len(part)-1].isdigit(): - part = part[:-1] - return part - -#def isWholedisk(domUname): -# """Determines whether dev is a wholedisk dev""" -# return not domUname[-1:].isdigit() - -# If available, add '-f' option (bnc#613584) -if kpartx_has_opt('f'): - kpartx_args += ' -f' - -class Wholedisk: - "Class representing a whole disk that may have partitions" - def __init__(self, vdev, pdev): - "c'tor: set up" - # Initialize object; will not raise: - self.ldev = None - self.vdev = vdev - self.pdev = pdev - self.mapped = 0 - self.partitions = [] - self.pcount = 0 - self.lvm = False - # Finish initialization; may raise: - self.is_blk = (S_ISBLK(os.stat(pdev)[ST_MODE])) - self.pcount = self.scanpartitions() - - def physdev(self): - """Gets the physical device used to access the device from dom0""" - if self.ldev: - return self.ldev - return self.pdev - - def findPart(self, vdev): - "Find device dev in list of partitions" - if len(vdev) > 5 and vdev[:5] == "/dev/": - vdev = vdev[5:] - for part in self.partitions: - if vdev == part.vdev: - return part - if len(self.partitions): - return self.partitions[0] - return None - - def loopsetup(self): - """Sets up the loop mapping for a disk image. - - Will raise if no loopbacks are available. - """ - if not self.is_blk and not self.ldev: - # Loops through all loopback devices, attempting to - # find a free one to set up. Don't scan for free and - # then try to set it up as a separate step - too racy! - i = 0 - while True: - ldev = '/dev/loop%i' % (i) - if not os.path.exists(ldev): - break - i += 1 - fd = os.popen("losetup %s '%s' 2> /dev/null" % (ldev, self.pdev)) - if not fd.close(): - verbose_print("losetup %s '%s'" % (ldev, self.pdev)) - self.ldev = ldev - break - if not self.ldev: - raise RuntimeError("No free loop device found") - - def loopclean(self): - """Delete the loop mapping. - - Will never raise. - """ - if self.ldev: - verbose_print("losetup -d %s" % self.ldev) - # Even seemingly innocent queries like "losetup /dev/loop0" - # can temporarily block the loopback and cause transient - # failures deleting the loopback, hence the retry logic. - retries = 10 - while retries: - fd = os.popen("losetup -d %s" % self.ldev) - if not fd.close(): - self.ldev = None - break - else: - # Mappings may not have been deleted due to race - # between udev and dm - see bnc#379032. Causes - # loop devices to leak. Call kpartx -d again - os.system("kpartx %s -d '%s'" % (kpartx_args, self.physdev())) - time.sleep(0.1) - retries -= 1 - - def scanlvmpartitions(self): - pcount = 0 - verbose_print("vgchange -ay '%s'" % (self.vdev)) - ret = os.system("vgchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 - if not ret: - self.lvm = True - verbose_print("lvscan | grep '/dev/%s'" % (self.vdev)) - fd = os.popen("lvscan | grep '/dev/%s'" % (self.vdev)) - for line in fd.readlines(): - line = line.strip() - (t1, lvname, t2) = line.split('\'') - pname = lvname[lvname.rfind('/')+1:] - pname = pname.strip() - pname = "/dev/mapper/" + self.vdev + "-" + pname - verbose_print("Found partition: vdev %s, pdev %s" % (self.vdev, pname)) - self.partitions.append(Partition(self, self.vdev, pname)) - pcount += 1 - fd.close() - verbose_print("vgchange -an '%s'" % (self.vdev)) - os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev)) - else: - verbose_print("vgchange -ay %s ... failed: -%d" % (self.vdev, ret)) - - return pcount - - def scanpartitions(self): - """Scan device for partitions (kpartx -l) and set up data structures, - Returns number of partitions found.""" - self.loopsetup() - # TODO: We could use fdisk -l instead and look at the type of - # partitions; this way we could also detect LVM and support it. - verbose_print("kpartx %s -l '%s'" % (kpartx_args, self.physdev())) - fd = os.popen("kpartx %s -l '%s'" % (kpartx_args, self.physdev())) - pcount = 0 - for line in fd.readlines(): - line = line.strip() - verbose_print("kpartx -l: %s" % (line,)) - (pname, params) = line.split(' : ') - pname = pname.strip() - pno = int(traildigits(pname)) - #if pname.rfind('/') != -1: - # pname = pname[pname.rfind('/')+1:] - #pname = self.pdev[:self.pdev.rfind('/')] + '/' + pname - pname = "/dev/mapper/" + pname - verbose_print("Found partition: vdev %s, pdev %s" % ('%s%i' % (self.vdev, pno), pname)) - self.partitions.append(Partition(self, '%s%i' % (self.vdev, pno), pname)) - pcount += 1 - fd.close() - - # Try lvm - if not pcount: - pcount = self.scanlvmpartitions() - - # Add self to partition table - if not pcount: - if self.ldev: - ref = self - else: - ref = None - self.partitions.append(Partition(ref, self.vdev, self.pdev)) - return pcount - - def activatepartitions(self): - "Set up loop mapping and device-mapper mappings" - verbose_print("activatepartitions") - if not self.mapped: - self.loopsetup() - if self.pcount: - verbose_print("kpartx %s -a '%s'" % (kpartx_args, self.physdev())) - fd = os.popen("kpartx %s -a '%s'" % (kpartx_args, self.physdev())) - fd.close() - if self.pcount and self.lvm: - verbose_print("vgchange -ay '%s'" % (self.vdev)) - ret = os.system("vgchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 - if not ret: - verbose_print("lvchange -ay '%s'" % (self.vdev)) - os.system("lvchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) - self.mapped += 1 - - def partitionsdeactivated(self): - "Return True if partition mappings have been removed, False otherwise" - for part in self.partitions: - if os.access(part.pdev, os.F_OK): - return False - return True - - def deactivatepartitions(self): - """Remove device-mapper mappings and loop mapping. - - Will never raise. - """ - verbose_print("deactivatepartitions") - if not self.mapped: - return - self.mapped -= 1 - if not self.mapped: - if self.pcount: - retries = 10 - while retries and not self.partitionsdeactivated(): - verbose_print("kpartx %s -d '%s'" % (kpartx_args, self.physdev())) - os.system("kpartx %s -d '%s'" % (kpartx_args, self.physdev())) - time.sleep(0.1) - retries -= 1 - if retries == 0: - error("unable to remove partition mappings with kpartx -d") - if self.pcount and self.lvm: - verbose_print("lvchange -an '%s'" % (self.vdev)) - ret = os.system("lvchange -an '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 - if ret: - time.sleep(0.3) - os.system("lvchange -an '/dev/%s' > /dev/null 2>&1" % (self.vdev)) - verbose_print("vgchange -an '%s'" % (self.vdev)) - ret = os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev)) >> 8 - if ret: - time.sleep(0.3) - os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev)) - self.loopclean() - - def __del__(self): - "d'tor: clean up" - self.deactivatepartitions() - self.loopclean() - - def __repr__(self): - "string representation for debugging" - strg = "[" + self.vdev + "," + self.pdev + "," - if self.ldev: - strg += self.ldev - strg += "," + str(self.pcount) + ",mapped %ix]" % self.mapped - return strg - -class Partition: - """Class representing a domU filesystem (partition) that can be - mounted in dom0""" - def __init__(self, whole = None, vdev = None, pdev = None): - "c'tor: setup" - self.wholedisk = whole - self.vdev = vdev - self.pdev = pdev - self.mountpoint = None - - def __del__(self): - "d'tor: cleanup" - if self.mountpoint: - self.umount() - # Not needed: Refcounting will take care of it. - #if self.wholedisk: - # self.wholedisk.deactivatepartitions() - - def __repr__(self): - "string representation for debugging" - strg = "[" + self.vdev + "," + self.pdev + "," - if self.mountpoint: - strg += "mounted on " + self.mountpoint + "," - else: - strg += "not mounted," - if self.wholedisk: - return strg + self.wholedisk.__repr__() + "]" - else: - return strg + "]" - - def mount(self, fstype = None, options = "ro"): - "mount filesystem, sets self.mountpoint" - if self.mountpoint: - return - if self.wholedisk: - self.wholedisk.activatepartitions() - mtpt = tempfile.mkdtemp(prefix = "%s." % self.vdev, dir = tmpdir) - mopts = "" - if fstype: - mopts += " -t %s" % fstype - if options: - mopts += " -o %s" % options - verbose_print("mount %s '%s' %s" % (mopts, self.pdev, mtpt)) - fd = os.popen("mount %s '%s' %s" % (mopts, self.pdev, mtpt)) - err = fd.close() - if err: - try: - os.rmdir(mtpt) - except: - pass - raise RuntimeError("Error %i from mount %s '%s' on %s" % \ - (err, mopts, self.pdev, mtpt)) - self.mountpoint = mtpt - - def umount(self): - """umount filesystem at self.mountpoint""" - if not self.mountpoint: - return - verbose_print("umount %s" % self.mountpoint) - fd = os.popen("umount %s" % self.mountpoint) - err = fd.close() - try: - os.rmdir(self.mountpoint) - except: - pass - if err: - error("Error %i from umount %s" % (err, self.mountpoint)) - else: - self.mountpoint = None - if self.wholedisk: - self.wholedisk.deactivatepartitions() - -def parseEntry(entry): - "disects bootentry and returns vdev, kernel, ramdisk" - def bad(): - raise RuntimeError, "Malformed --entry" - fsspl = entry.split(':') - if len(fsspl) != 2: - bad() - vdev = fsspl[0] - entry = fsspl[1] - enspl = entry.split(',') - if len(enspl) not in (1, 2): - bad() - # Prepend '/' if missing - kernel = enspl[0] - if kernel == '': - bad() - if kernel[0] != '/': - kernel = '/' + kernel - ramdisk = None - if len(enspl) > 1: - ramdisk = enspl[1] - if ramdisk != '' and ramdisk[0] != '/': - ramdisk = '/' + ramdisk - return vdev, kernel, ramdisk - -def copyFile(src, dst): - "Wrapper for shutil.filecopy" - import shutil - verbose_print("cp %s %s" % (src, dst)) - stat = os.stat(src) - if stat.st_size > 16*1024*1024: - raise RuntimeError("Too large file %s (%s larger than 16MB)" \ - % (src, stat.st_size)) - try: - shutil.copyfile(src, dst) - except: - os.unlink(dst) - raise() - -def copyKernelAndRamdisk(disk, vdev, kernel, ramdisk): - """Finds vdev in list of partitions, mounts the partition, copies - kernel [and ramdisk] off to dom0 files, umounts the parition again, - and returns sxpr pointing to these copies.""" - verbose_print("copyKernelAndRamdisk(%s, %s, %s, %s)" % (disk, vdev, kernel, ramdisk)) - if dryrun: - return "linux (kernel kernel.dummy) (ramdisk ramdisk.dummy)" - part = disk.findPart(vdev) - if not part: - raise RuntimeError("Partition '%s' does not exist" % vdev) - part.mount() - try: - (fd, knm) = tempfile.mkstemp(prefix = "kernel.", dir = tmpdir) - os.close(fd) - copyFile(part.mountpoint + kernel, knm) - except: - os.unlink(knm) - part.umount() - raise - if not quiet: - print "Copy kernel %s from %s to %s for booting" % (kernel, vdev, knm) - sxpr = "linux (kernel %s)" % knm - if ramdisk: - try: - (fd, inm) = tempfile.mkstemp(prefix = "ramdisk.", dir = tmpdir) - os.close(fd) - copyFile(part.mountpoint + ramdisk, inm) - except: - os.unlink(knm) - os.unlink(inm) - part.umount() - raise - sxpr += "(ramdisk %s)" % inm - part.umount() - xnloader.patch_netware_loader(knm) - return sxpr - -def main(argv): - "Main routine: Parses options etc." - global quiet, dryrun, verbose, tmpdir, in_args - def usage(): - "Help output (usage info)" - global verbose, quiet, dryrun - print >> sys.stderr, "domUloader usage: domUloader [--output=fd] [--quiet] [--dryrun] [--verbose]\n" +\ - "[--args] [--help] --entry=dev:kernel[,ramdisk] physdisk [virtdisk]\n" +\ - "\n" +\ - "dev format: hd[a-p][0-9]*, xvd[a-p][0-9]*, LVM-vgname-lvname\n" - print >> sys.stderr, __doc__ - - try: - (optlist, args) = getopt.gnu_getopt(argv, 'qvh', \ - ('entry=', 'output=', 'tmpdir=', 'args=', 'kernel=', 'ramdisk=', 'help', 'quiet', 'dryrun', 'verbose')) - except: - usage() - sys.exit(1) - - entry = None - output = None - pdisk = None - vdisk = None - - for (opt, oarg) in optlist: - if opt in ('-h', '--help'): - usage() - sys.exit(1) - elif opt in ('-q', '--quiet'): - quiet = True - elif opt in ('-n', '--dryrun'): - dryrun = True - elif opt in ('-v', '--verbose'): - verbose = True - elif opt == '--output': - output = oarg - elif opt == '--entry': - entry = oarg - elif opt == '--tmpdir': - tmpdir = oarg - elif opt == '--args': - in_args = oarg - - verbose_print(str(argv)) - - if args: - if len(args) == 2: - pdisk = args[1] - elif len(args) == 3: - pdisk = args[1] - vdisk = args[2] - - if not entry or not pdisk: - usage() - sys.exit(1) - - if output is None or output == "-": - fd = sys.stdout.fileno() - else: - fd = os.open(output, os.O_WRONLY) - - if not os.access(tmpdir, os.X_OK): - os.mkdir(tmpdir) - os.chmod(tmpdir, 0750) - - vdev, kernel, ramdisk = parseEntry(entry) - if vdev[:vdev.find('-')] == "LVM": - vdev = vdev.split('-')[1] - if not vdisk: - vdisk = getWholedisk(vdev) - verbose_print("vdisk not specified; guessing '%s' based on '%s'" % (vdisk, vdev)) - if not vdev.startswith(vdisk): - error("Virtual disk '%s' does not match entry '%s'" % (vdisk, entry)) - sys.exit(1) - disk = Wholedisk(vdisk, pdisk) - - r = 0 - try: - sxpr = copyKernelAndRamdisk(disk, vdev, kernel, ramdisk) - if in_args: - sxpr += "(args '%s')" % in_args - os.write(fd, sxpr) - except Exception, e: - error(str(e)) - r = 1 - - for part in disk.partitions: - part.wholedisk = None - del disk - - return r - -# Call main if called (and not imported) -if __name__ == "__main__": - r = 1 - try: - r = main(sys.argv) - except Exception, e: - error(str(e)) - sys.exit(r) diff --git a/init.xend b/init.xend deleted file mode 100644 index 98fabdc..0000000 --- a/init.xend +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash -# -# xend Starts and stops the Xen management daemon -# -# chkconfig: 35 98 01 -# description: Starts and stops the Xen management daemon -# -### BEGIN INIT INFO -# Provides: xend -# Required-Start: $syslog $network $remote_fs -# Should-Start: iscsi $time -# Required-Stop: $syslog $network $remote_fs -# Should-Stop: iscsi $time -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Starts and stops the Xen management daemon -# Description: Starts and stops the Xen management daemon. xend is needed -# to create and manage VMs on Xen. -### END INIT INFO - -. /etc/rc.status -rc_reset - -XEND=`pidof -x /usr/sbin/xend` - -await_daemons_up() -{ - i=1 - rets=10 - xend status - while [ $? -ne 0 -a $i -lt $rets ]; do - sleep 1 - echo -n . - i=$(($i + 1)) - xend status - done -} - -xend_abort() -{ - echo -n "xend " - rc_failed $1 - rc_status -v - rc_exit -} - -cleanup() -{ - rm -f /var/lib/xen/tmp/* 2>/dev/null - rm -f /var/lib/xen/xenbl* 2>/dev/null -} - -check() -{ - if [ "$1" == status ]; then - if [ ! -e /proc/xen/capabilities ]; then - xend_abort 3 - fi - else - if [ `id -u` != 0 ]; then - xend_abort 4 - fi - if [ ! -e /proc/xen/capabilities ] || - ! grep control_d /proc/xen/capabilities >/dev/null 2>&1; then - if [ "$1" == stop ] || - [ "$1" == try-restart ]; then - xend_abort 0 - else - xend_abort 6 - fi - fi - fi -} - -case "$1" in - start) - check $1 - echo -n "Starting xend " - if [ ! -z "$XEND" ]; then - echo -n "(already running pid $XEND) " - else - cleanup - fi - xend start - await_daemons_up - ;; - stop) - check $1 - echo -n "Stopping xend " - if [ -z "$XEND" ]; then - echo -n "(not running) " - xend stop - rc_reset - else - echo -n "(pid $XEND) " - xend stop - cleanup - rc_reset - fi - ;; - status) - check $1 - echo -n "Checking status of xend " - if [ ! -z "$XEND" ]; then - echo -n "(pid $XEND) " - fi - checkproc /usr/sbin/xend - ;; - restart|reload) - check $1 - echo -n "Restarting xend " - if [ -z "$XEND" ]; then - echo -n "(not running) " - else - echo -n "(old pid $XEND) " - fi - xend restart - await_daemons_up - ;; - try-restart) - check $1 - $0 status - if [ $? = 0 ]; then - $0 restart - else - rc_reset - fi - ;; - *) - echo "Usage: $0 {start|stop|restart|try-restart|reload|status}" - rc_failed 2 - rc_exit -esac - -rc_status -v -rc_exit diff --git a/init.xendomains b/init.xendomains deleted file mode 100644 index b1bd776..0000000 --- a/init.xendomains +++ /dev/null @@ -1,511 +0,0 @@ -#!/bin/bash -# -# xendomains Starts and stops Xen VMs -# -# chkconfig: 35 99 00 -# description: Starts and stops Xen VMs -# -### BEGIN INIT INFO -# Provides: xendomains -# Required-Start: $syslog $remote_fs xenstored xenconsoled -# Should-Start: xend iscsi o2cb ocfs2 -# Required-Stop: $syslog $remote_fs xenstored xenconsoled -# Should-Stop: xend iscsi -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Starts and stops Xen VMs -# Description: Starts and stops Xen VMs automatically when the -# host starts and stops. -### END INIT INFO - -. /etc/rc.status -rc_reset - -RETCODE_FILE=/tmp/xendomains.rc.$$ -xm_cmd=echo - -# See docs/misc/distro_mapping.txt -if [ -d /var/lock/subsys ]; then - LOCKFILE=/var/lock/subsys/xendomains -else - LOCKFILE=/var/lock/xendomains -fi - -if [ -d /etc/sysconfig ]; then - XENDOM_CONFIG=/etc/sysconfig/xendomains -else - XENDOM_CONFIG=/etc/default/xendomains -fi - -test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; - if [ "$1" = "stop" ]; then exit 0; - else exit 6; fi; } - -. "$XENDOM_CONFIG" - -shopt -s dotglob nullglob - -smart_term=1 -if [ -z "$esc" ]; then - smart_term=0 - rc_timer_on() - { - (trap "exit 0" TERM; sleep $1) & _rc_timer_pid=$! - } - rc_timer_off() - { - if [ -n "$_rc_timer_pid" ]; then - kill -TERM $_rc_timer_pid > /dev/null 2>&1 - fi - unset _rc_timer_pid - } -fi - -xendomains_abort() -{ - echo -n "xendomains " - rc_failed $1 - rc_status -v - rc_exit -} - -check() -{ - XEND=`pidof -x /usr/sbin/xend` - if [ -z "$XEND" ]; then - xm_cmd="xl -f" - XEND="xl" - else - xm_cmd="xm" - fi - if [ "$1" = status ]; then - if [ ! -e /proc/xen/capabilities ] || [ ! -r "$XENDOM_CONFIG" ] || [ -z "$XEND" ]; then - xendomains_abort 3 - fi - else - if [ `id -u` != 0 ]; then - xendomains_abort 4 - fi - if [ ! -e /proc/xen/capabilities ] || [ -z "$XEND" ] || - ! grep control_d /proc/xen/capabilities >/dev/null 2>&1; then - if [ "$1" = stop ] || - [ "$1" = restart ]; then - xendomains_abort 0 - else - xendomains_abort 6 - fi - fi - if [ ! -r "$XENDOM_CONFIG" ]; then - xendomains_abort 6 - fi - fi -} - -dir_contains_something() -{ - [ -d "$1" ] || return 1 - local dirfiles=( "$1"/* ) - [ ${#dirfiles[@]} != 0 ] -} - -get_name_from_cfg() -{ - if grep -q "^name" "$1";then - NM=`grep '^name[ ]*=' "$1" | sed -e 's/^name[ ]*=[ ]*['\''"]\([^'\''"]*\)['\''"].*$/\1/'` - elif grep -q "(name " "$1";then - NM=`grep '(name ' "$1" | sed -e 's/^ *//' | cut -d " " -f 2 | sed -e 's/)//'` - fi -} - -running_auto_names() -{ - unset AUTONAMES[@] - if ! dir_contains_something "$XENDOMAINS_AUTO"; then - return - fi - for dom in "$XENDOMAINS_AUTO"/*; do - get_name_from_cfg "$dom" - AUTONAMES+=("$NM") - done -} - -parseln() -{ - name=${1:0:$((${#1}-36))} - name=${name%% *} - rest="${1: -36}" - id=${rest:0:4} - id=`echo $id` - mem=${rest:4:6} - mem=`echo $mem` - vcpu=${rest:10:6} - vcpu=`echo $vcpu` - state=${rest:16:11} - state=`echo $state` - tm=${rest:27} - tm=`echo $tm` -} - -xm_list() -{ - TERM=vt100 ${xm_cmd} list | grep -v '^Name *ID' -} - -is_cfg_running() -{ - get_name_from_cfg "$1" - while read LN; do - parseln "$LN" - [ "$id" = 0 ] && continue - if [ "$name" = "$NM" ]; then - [ -z "$state" ] && return 1 - return 0 - fi - done < <(xm_list) - return 1 -} - -start() -{ - if [ -f "$LOCKFILE" ]; then - echo -n "xendomains already running (lockfile exists)" - rc_reset - rc_status -v - return 0 - fi - - local printed=0 - - if [ "$XENDOMAINS_RESTORE" = "true" ] && - dir_contains_something "$XENDOMAINS_SAVE"; then - mkdir -p $(dirname "$LOCKFILE") - touch "$LOCKFILE" - echo "Restoring saved Xen domains" - printed=1 - for dom in "$XENDOMAINS_SAVE"/*; do - echo -n " ${dom##*/}: " - ${xm_cmd} restore "$dom" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - rc_failed - else - rc_reset - rm -f "$dom" - fi - rc_status -v - done - fi - - if dir_contains_something "$XENDOMAINS_AUTO"; then - touch "$LOCKFILE" - echo "Starting auto Xen domains" - printed=1 - for dom in "$XENDOMAINS_AUTO"/*; do - echo -n " ${dom##*/}: " - if is_cfg_running "$dom"; then - rc_status -s - else - if grep -q "^name" "$dom";then - ${xm_cmd} create --quiet --defconfig "$dom" - elif grep -q "(name .*" "$dom";then - ${xm_cmd} create --quiet --config "$dom" - fi - if [ $? -ne 0 ]; then - rc_failed - else - usleep $XENDOMAINS_CREATE_USLEEP - rc_reset - fi - rc_status -v - fi - done - fi - - if [ $printed -eq 0 ]; then - echo -n "Starting xendomains" - rc_failed 6 # not configured - rc_status -v - fi -} - -is_zombie_state() -{ - [ "$1" = "-b---d" ] || [ "$1" = "-----d" ] -} - -any_non_zombies() -{ - while read LN; do - parseln "$LN" - [ "$id" = 0 ] && continue - [ -z "$state" ] && continue - is_zombie_state "$state" || return 0 - done < <(xm_list) - return 1 -} - -migrate_with_watchdog() -{ - (${xm_cmd} migrate "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 & - watchdog_xm $! -} - -save_with_watchdog() -{ - (${xm_cmd} save "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 & - watchdog_xm $! -} - -shutdown_with_watchdog() -{ - (${xm_cmd} shutdown -w "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 & - watchdog_xm $! -} - -get_return_code() -{ - local RC=127 - [ -r "$RETCODE_FILE" ] && RC=`head -c10 "$RETCODE_FILE"` - rm -f "$RETCODE_FILE" - return $RC -} - -# $1: The PID to wait on. -watchdog_xm() -{ - local col=$((COLUMNS-11)) - if [ -z "$XENDOMAINS_STOP_MAXWAIT" ] || [ "$XENDOMAINS_STOP_MAXWAIT" = "0" ]; then - wait $1 >/dev/null 2>&1 - get_return_code - return - fi - - rc_timer_on $XENDOMAINS_STOP_MAXWAIT $col - while true; do - # Prefer "jobs" over "ps": faster and no false positives - pid=`jobs -l | grep " $1 Running"` - if [ -z "$pid" ]; then - break - fi - pid=`jobs -l | grep " $_rc_timer_pid Running"` - if [ -z "$pid" ]; then - disown $1 # To avoid the "Terminated..." message - kill $1 >/dev/null 2>&1 - fi - sleep 1 - done - rc_timer_off - if [ $smart_term -ne 0 ]; then - echo -en "\015${esc}[${col}C " - fi - get_return_code -} - -stop() -{ - echo "Shutting down Xen domains" - if [ "$XENDOMAINS_AUTO_ONLY" = "true" ]; then - running_auto_names - fi - local printed=0 - while read LN; do - parseln "$LN" - [ "$id" = 0 ] && continue - [ -z "$state" ] && continue - printed=1 - if [ "$XENDOMAINS_AUTO_ONLY" = "true" ]; then - is_auto_domain=0 - for n in "${AUTONAMES[@]}"; do - if [ "$name" = "$n" ]; then - is_auto_domain=1 - break - fi - done - if [ $is_auto_domain -eq 0 ]; then - echo -n " $name: " - rc_status -s - continue - fi - fi - if [ -n "$XENDOMAINS_SYSRQ" ]; then - for sysrq in $XENDOMAINS_SYSRQ; do - echo -n " $name: " - echo -n "sending sysrq '$sysrq'... " - ${xm_cmd} sysrq $id $sysrq - if [ $? -ne 0 ]; then - rc_failed - else - rc_reset - fi - rc_status -v - # usleep just ignores empty arg - usleep $XENDOMAINS_USLEEP - done - fi - if is_zombie_state "$state"; then - echo -n " $name: " - echo -n "destroying zombie... " - ${xm_cmd} destroy $id - rc_reset - rc_status -v - continue - fi - if [ -n "$XENDOMAINS_MIGRATE" ]; then - echo -n " $name: " - echo -n "migrating... " - migrate_with_watchdog $id "$XENDOMAINS_MIGRATE" - if [ $? -ne 0 ]; then - rc_failed - rc_status -v - else - rc_reset - rc_status -v - continue - fi - fi - if [ -n "$XENDOMAINS_SAVE" ]; then - echo -n " $name: " - echo -n "saving... " - save_with_watchdog $id "$XENDOMAINS_SAVE/$name" - if [ $? -ne 0 ]; then - rm -f "$XENDOMAINS_SAVE/$name" - rc_failed - rc_status -v - else - rc_reset - rc_status -v - continue - fi - fi - if [ -n "$XENDOMAINS_SHUTDOWN" ]; then - echo -n " $name: " - echo -n "shutting down... " - shutdown_with_watchdog $id $XENDOMAINS_SHUTDOWN - if [ $? -ne 0 ]; then - rc_failed - else - rc_reset - fi - rc_status -v - fi - done < <(xm_list) - - if [ -n "$XENDOMAINS_SHUTDOWN_ALL" ] && any_non_zombies ; then - echo -n " others: shutting down... " - shutdown_with_watchdog $XENDOMAINS_SHUTDOWN_ALL - if [ $? -ne 0 ]; then - rc_failed - else - rc_reset - fi - rc_status -v - fi - - if [ $printed -eq 0 ]; then - echo -e "${rc_done_up}" - fi - - # Unconditionally delete lock file - rm -f "$LOCKFILE" -} - -check_domain_up() -{ - while read LN; do - parseln "$LN" - [ "$id" = 0 ] && continue - if [ "$name" = "$1" ]; then - [ -z "$state" ] && return 1 - return 0 - fi - done < <(xm_list) - return 1 -} - -check_all_domains_up() -{ - any_auto=0 - any_save=0 - dir_contains_something "$XENDOMAINS_AUTO" && any_auto=1 - dir_contains_something "$XENDOMAINS_SAVE" && any_save=1 - if [ $any_auto -eq 0 ] && [ $any_save -eq 0 ]; then - rc_reset - rc_status -v - return - fi - echo - if [ $any_auto -ne 0 ]; then - for nm in "$XENDOMAINS_AUTO"/*; do - get_name_from_cfg "$nm" - echo -n " $nm: " - if check_domain_up "$NM"; then - rc_reset - else - rc_failed 2 - fi - rc_status -v - done - fi - if [ $any_save -ne 0 ]; then - for nm in "$XENDOMAINS_SAVE"/*; do - echo -n " $nm: " - rc_failed 3 - rc_status -v - done - fi -} - -# This does NOT necessarily restart all running domains: instead it -# stops all running domains and then boots all the domains specified in -# AUTODIR. If other domains have been started manually then they will -# not get restarted. -restart() -{ - "$0" stop - start -} - -case "$1" in - start) - check $1 - start - ;; - - stop) - check $1 - stop - ;; - - restart|reload) - check $1 - restart - ;; - - try-restart) - check $1 - "$0" status - if [ $? = 0 ]; then - "$0" restart - else - rc_reset - rc_status -v - fi - ;; - - status) - check $1 - echo -n "Checking status of Xen domains" - if [ ! -f "$LOCKFILE" ]; then - rc_failed 3 - rc_status -v - else - check_all_domains_up - fi - ;; - - *) - echo "Usage: $0 {start|stop|restart|try-restart|reload|status}" - rc_failed 2 - ;; -esac - -rc_exit diff --git a/ioemu-blktap-zero-size.patch b/ioemu-blktap-zero-size.patch index a4877fc..7718951 100644 --- a/ioemu-blktap-zero-size.patch +++ b/ioemu-blktap-zero-size.patch @@ -29,16 +29,3 @@ Index: xen-4.2.0-testing/tools/qemu-xen-traditional-dir-remote/hw/xen_blktap.c s->info = ((s->flags & TD_RDONLY) ? VDISK_READONLY : 0); #ifndef QEMU_TOOL -Index: xen-4.2.0-testing/tools/python/xen/xend/server/DevController.py -=================================================================== ---- xen-4.2.0-testing.orig/tools/python/xen/xend/server/DevController.py -+++ xen-4.2.0-testing/tools/python/xen/xend/server/DevController.py -@@ -155,7 +155,7 @@ class DevController: - (devid, self.deviceClass)) - - elif status == Error: -- self.destroyDevice(devid, False) -+ self.destroyDevice(devid, True) - if err is None: - raise VmError("Device %s (%s) could not be connected. " - "Backend device not found." % diff --git a/ioemu-disable-emulated-ide-if-pv.patch b/ioemu-disable-emulated-ide-if-pv.patch index cbd00c9..6aada8b 100644 --- a/ioemu-disable-emulated-ide-if-pv.patch +++ b/ioemu-disable-emulated-ide-if-pv.patch @@ -1,7 +1,7 @@ -Index: xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h =================================================================== ---- xen-4.2.3-testing.orig/tools/qemu-xen-traditional-dir-remote/qemu-xen.h -+++ xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/qemu-xen.h ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h @@ -1,6 +1,8 @@ #ifndef QEMU_XEN_H #define QEMU_XEN_H @@ -20,10 +20,10 @@ Index: xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/qemu-xen.h int xenstore_parse_disable_pf_config(void); int xenstore_fd(void); void xenstore_process_event(void *opaque); -Index: xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/vl.c +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c =================================================================== ---- xen-4.2.3-testing.orig/tools/qemu-xen-traditional-dir-remote/vl.c -+++ xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/vl.c +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/vl.c ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/vl.c @@ -5862,9 +5862,9 @@ int main(int argc, char **argv, char **e if ((msg = xenbus_read(XBT_NIL, "domid", &domid_s))) fprintf(stderr,"Can not read our own domid: %s\n", msg); @@ -36,11 +36,11 @@ Index: xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/vl.c #endif /* CONFIG_STUBDOM */ } -Index: xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c +Index: xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c =================================================================== ---- xen-4.2.3-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c -+++ xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c -@@ -446,7 +446,7 @@ void xenstore_init(void) +--- xen-4.5.0-testing.orig/tools/qemu-xen-traditional-dir-remote/xenstore.c ++++ xen-4.5.0-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c +@@ -445,7 +445,7 @@ void xenstore_init(void) } } @@ -49,7 +49,7 @@ Index: xen-4.2.3-testing/tools/qemu-xen-traditional-dir-remote/xenstore.c { char **e_danger = NULL; char *buf = NULL; -@@ -740,11 +740,19 @@ void xenstore_parse_domain_config(int hv +@@ -739,11 +739,19 @@ void xenstore_parse_domain_config(int hv #endif diff --git a/ipxe.tar.bz2 b/ipxe.tar.bz2 index 74139c3..f5efa59 100644 --- a/ipxe.tar.bz2 +++ b/ipxe.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:736479fcbc2a8679a67ecd06a60e9c6af9bb7f0b582b31db6e9fad1679eeea1b -size 2877494 +oid sha256:71ec2c199f41fe74e647f4065df60d99cc62ed684ef37f4267a457a2f65b1aff +size 2877265 diff --git a/libxc-pass-errno-to-callers-of-xc_domain_save.patch b/libxc-pass-errno-to-callers-of-xc_domain_save.patch deleted file mode 100644 index 8342adc..0000000 --- a/libxc-pass-errno-to-callers-of-xc_domain_save.patch +++ /dev/null @@ -1,647 +0,0 @@ -From b7fc90f3d4f0d61281312c5d05859ee2de8fc8be Mon Sep 17 00:00:00 2001 -From: Olaf Hering -Date: Mon, 10 Feb 2014 12:47:26 +0100 -Subject: libxc: pass errno to callers of xc_domain_save - -Callers of xc_domain_save use errno to print diagnostics if the call -fails. But xc_domain_save does not preserve the actual errno in case of -a failure. - -This change preserves errno in all cases where code jumps to the label -"out". In addition a new label "exit" is added to catch also code which -used to do just "return 1". - -Now libxl_save_helper:complete can print the actual error string. - -Note: some of the functions used in xc_domain_save do not use errno to -indicate a reason. In these cases the errno remains undefined as it used -to be without this change. - -Signed-off-by: Olaf Hering ---- - tools/libxc/xc_domain_save.c | 88 +++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 82 insertions(+), 6 deletions(-) - -diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c -index 42c4752..f32ac81 100644 ---- a/tools/libxc/xc_domain_save.c -+++ b/tools/libxc/xc_domain_save.c -@@ -806,6 +806,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - xc_dominfo_t info; - DECLARE_DOMCTL; - -+ int errnoval = 0; - int rc = 1, frc, i, j, last_iter = 0, iter = 0; - int live = (flags & XCFLAGS_LIVE); - int debug = (flags & XCFLAGS_DEBUG); -@@ -898,8 +899,8 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( hvm && !callbacks->switch_qemu_logdirty ) - { - ERROR("No switch_qemu_logdirty callback provided."); -- errno = EINVAL; -- return 1; -+ errnoval = EINVAL; -+ goto exit; - } - - outbuf_init(xch, &ob_pagebuf, OUTBUF_SIZE); -@@ -913,14 +914,16 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( !get_platform_info(xch, dom, - &ctx->max_mfn, &ctx->hvirt_start, &ctx->pt_levels, &dinfo->guest_width) ) - { -+ errnoval = errno; - ERROR("Unable to get platform info."); -- return 1; -+ goto exit; - } - - if ( xc_domain_getinfo(xch, dom, 1, &info) != 1 ) - { -+ errnoval = errno; - PERROR("Could not get domain info"); -- return 1; -+ goto exit; - } - - shared_info_frame = info.shared_info_frame; -@@ -932,6 +935,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - PROT_READ, shared_info_frame); - if ( !live_shinfo ) - { -+ errnoval = errno; - PERROR("Couldn't map live_shinfo"); - goto out; - } -@@ -942,6 +946,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( dinfo->p2m_size > ~XEN_DOMCTL_PFINFO_LTAB_MASK ) - { -+ errnoval = E2BIG; - ERROR("Cannot save this big a guest"); - goto out; - } -@@ -967,6 +972,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( frc < 0 ) - { -+ errnoval = errno; - PERROR("Couldn't enable shadow mode (rc %d) (errno %d)", frc, errno ); - goto out; - } -@@ -975,6 +981,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - /* Enable qemu-dm logging dirty pages to xen */ - if ( hvm && callbacks->switch_qemu_logdirty(dom, 1, callbacks->data) ) - { -+ errnoval = errno; - PERROR("Couldn't enable qemu log-dirty mode (errno %d)", errno); - goto out; - } -@@ -985,6 +992,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( suspend_and_state(callbacks->suspend, callbacks->data, xch, - io_fd, dom, &info) ) - { -+ errnoval = errno; - ERROR("Domain appears not to have suspended"); - goto out; - } -@@ -994,6 +1002,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - { - if (!(compress_ctx = xc_compression_create_context(xch, dinfo->p2m_size))) - { -+ errnoval = errno; - ERROR("Failed to create compression context"); - goto out; - } -@@ -1012,6 +1021,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( !to_send || !to_fix || !to_skip ) - { -+ errnoval = ENOMEM; - ERROR("Couldn't allocate to_send array"); - goto out; - } -@@ -1024,12 +1034,14 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - hvm_buf_size = xc_domain_hvm_getcontext(xch, dom, 0, 0); - if ( hvm_buf_size == -1 ) - { -+ errnoval = errno; - PERROR("Couldn't get HVM context size from Xen"); - goto out; - } - hvm_buf = malloc(hvm_buf_size); - if ( !hvm_buf ) - { -+ errnoval = ENOMEM; - ERROR("Couldn't allocate memory"); - goto out; - } -@@ -1043,7 +1055,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (pfn_type == NULL) || (pfn_batch == NULL) || (pfn_err == NULL) ) - { - ERROR("failed to alloc memory for pfn_type and/or pfn_batch arrays"); -- errno = ENOMEM; -+ errnoval = ENOMEM; - goto out; - } - memset(pfn_type, 0, -@@ -1052,6 +1064,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - /* Setup the mfn_to_pfn table mapping */ - if ( !(ctx->live_m2p = xc_map_m2p(xch, ctx->max_mfn, PROT_READ, &ctx->m2p_mfn0)) ) - { -+ errnoval = errno; - PERROR("Failed to map live M2P table"); - goto out; - } -@@ -1059,6 +1072,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - /* Start writing out the saved-domain record. */ - if ( write_exact(io_fd, &dinfo->p2m_size, sizeof(unsigned long)) ) - { -+ errnoval = errno; - PERROR("write: p2m_size"); - goto out; - } -@@ -1071,6 +1085,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - ctx->live_p2m = map_and_save_p2m_table(xch, io_fd, dom, ctx, live_shinfo); - if ( ctx->live_p2m == NULL ) - { -+ errnoval = errno; - PERROR("Failed to map/save the p2m frame list"); - goto out; - } -@@ -1097,12 +1112,14 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - tmem_saved = xc_tmem_save(xch, dom, io_fd, live, XC_SAVE_ID_TMEM); - if ( tmem_saved == -1 ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (tmem)"); - goto out; - } - - if ( !live && save_tsc_info(xch, dom, io_fd) < 0 ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (tsc)"); - goto out; - } -@@ -1143,6 +1160,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - dinfo->p2m_size, NULL, 0, NULL); - if ( frc != dinfo->p2m_size ) - { -+ errnoval = errno; - ERROR("Error peeking shadow bitmap"); - goto out; - } -@@ -1257,6 +1275,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - xch, dom, PROT_READ, pfn_type, pfn_err, batch); - if ( region_base == NULL ) - { -+ errnoval = errno; - PERROR("map batch failed"); - goto out; - } -@@ -1264,6 +1283,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - /* Get page types */ - if ( xc_get_pfn_type_batch(xch, dom, batch, pfn_type) ) - { -+ errnoval = errno; - PERROR("get_pfn_type_batch failed"); - goto out; - } -@@ -1332,6 +1352,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( wrexact(io_fd, &batch, sizeof(unsigned int)) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (2)"); - goto out; - } -@@ -1341,6 +1362,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - ((unsigned long *)pfn_type)[j] = pfn_type[j]; - if ( wrexact(io_fd, pfn_type, sizeof(unsigned long)*batch) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (3)"); - goto out; - } -@@ -1368,6 +1390,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - (char*)region_base+(PAGE_SIZE*(j-run)), - PAGE_SIZE*run) != PAGE_SIZE*run ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (4a)" - " (errno %d)", errno); - goto out; -@@ -1396,6 +1419,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( race && !live ) - { -+ errnoval = errno; - ERROR("Fatal PT race (pfn %lx, type %08lx)", pfn, - pagetype); - goto out; -@@ -1409,6 +1433,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - pfn, 1 /* raw page */); - if (c_err == -2) /* OOB PFN */ - { -+ errnoval = errno; - ERROR("Could not add pagetable page " - "(pfn:%" PRIpfn "to page buffer\n", pfn); - goto out; -@@ -1428,6 +1453,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - */ - if (wrcompressed(io_fd) < 0) - { -+ errnoval = errno; - ERROR("Error when writing compressed" - " data (4b)\n"); - goto out; -@@ -1437,6 +1463,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - else if ( wruncached(io_fd, live, page, - PAGE_SIZE) != PAGE_SIZE ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (4b)" - " (errno %d)", errno); - goto out; -@@ -1456,6 +1483,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if (c_err == -2) /* OOB PFN */ - { -+ errnoval = errno; - ERROR("Could not add page " - "(pfn:%" PRIpfn "to page buffer\n", pfn); - goto out; -@@ -1465,6 +1493,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - { - if (wrcompressed(io_fd) < 0) - { -+ errnoval = errno; - ERROR("Error when writing compressed" - " data (4c)\n"); - goto out; -@@ -1483,6 +1512,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - (char*)region_base+(PAGE_SIZE*(j-run)), - PAGE_SIZE*run) != PAGE_SIZE*run ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (4c)" - " (errno %d)", errno); - goto out; -@@ -1520,6 +1550,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - /* send "-1" to put receiver into debug mode */ - if ( wrexact(io_fd, &id, sizeof(int)) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (6)"); - goto out; - } -@@ -1542,6 +1573,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( suspend_and_state(callbacks->suspend, callbacks->data, - xch, io_fd, dom, &info) ) - { -+ errnoval = errno; - ERROR("Domain appears not to have suspended"); - goto out; - } -@@ -1550,12 +1582,14 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (tmem_saved > 0) && - (xc_tmem_save_extra(xch,dom,io_fd,XC_SAVE_ID_TMEM_EXTRA) == -1) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (tmem)"); - goto out; - } - - if ( save_tsc_info(xch, dom, io_fd) < 0 ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (tsc)"); - goto out; - } -@@ -1567,6 +1601,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - XEN_DOMCTL_SHADOW_OP_CLEAN, HYPERCALL_BUFFER(to_send), - dinfo->p2m_size, NULL, 0, &shadow_stats) != dinfo->p2m_size ) - { -+ errnoval = errno; - PERROR("Error flushing shadow PT"); - goto out; - } -@@ -1598,6 +1633,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( info.max_vcpu_id >= XC_SR_MAX_VCPUS ) - { -+ errnoval = E2BIG; - ERROR("Too many VCPUS in guest!"); - goto out; - } -@@ -1614,6 +1650,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( wrexact(io_fd, &chunk, offsetof(struct chunk, vcpumap) - + vcpumap_sz(info.max_vcpu_id)) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file"); - goto out; - } -@@ -1633,6 +1670,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the generation id buffer location for guest"); - goto out; - } -@@ -1645,6 +1683,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the ident_pt for EPT guest"); - goto out; - } -@@ -1657,6 +1696,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the paging ring pfn for guest"); - goto out; - } -@@ -1669,6 +1709,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the access ring pfn for guest"); - goto out; - } -@@ -1681,6 +1722,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the sharing ring pfn for guest"); - goto out; - } -@@ -1693,6 +1735,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the vm86 TSS for guest"); - goto out; - } -@@ -1705,6 +1748,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the console pfn for guest"); - goto out; - } -@@ -1716,6 +1760,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ((chunk.data != 0) && wrexact(io_fd, &chunk, sizeof(chunk))) - { -+ errnoval = errno; - PERROR("Error when writing the firmware ioport version"); - goto out; - } -@@ -1728,6 +1773,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (chunk.data != 0) && - wrexact(io_fd, &chunk, sizeof(chunk)) ) - { -+ errnoval = errno; - PERROR("Error when writing the viridian flag"); - goto out; - } -@@ -1741,6 +1787,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( callbacks->toolstack_save(dom, &buf, &len, callbacks->data) < 0 ) - { -+ errnoval = errno; - PERROR("Error calling toolstack_save"); - goto out; - } -@@ -1759,6 +1806,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - i = XC_SAVE_ID_LAST_CHECKPOINT; - if ( wrexact(io_fd, &i, sizeof(int)) ) - { -+ errnoval = errno; - PERROR("Error when writing last checkpoint chunk"); - goto out; - } -@@ -1778,6 +1826,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - i = XC_SAVE_ID_ENABLE_COMPRESSION; - if ( wrexact(io_fd, &i, sizeof(int)) ) - { -+ errnoval = errno; - PERROR("Error when writing enable_compression marker"); - goto out; - } -@@ -1787,6 +1836,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - i = 0; - if ( wrexact(io_fd, &i, sizeof(int)) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (6')"); - goto out; - } -@@ -1805,6 +1855,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - (unsigned long *)&magic_pfns[2]); - if ( wrexact(io_fd, magic_pfns, sizeof(magic_pfns)) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (7)"); - goto out; - } -@@ -1813,18 +1864,21 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( (rec_size = xc_domain_hvm_getcontext(xch, dom, hvm_buf, - hvm_buf_size)) == -1 ) - { -+ errnoval = errno; - PERROR("HVM:Could not get hvm buffer"); - goto out; - } - - if ( wrexact(io_fd, &rec_size, sizeof(uint32_t)) ) - { -+ errnoval = errno; - PERROR("error write hvm buffer size"); - goto out; - } - - if ( wrexact(io_fd, hvm_buf, rec_size) ) - { -+ errnoval = errno; - PERROR("write HVM info failed!"); - goto out; - } -@@ -1849,6 +1903,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( wrexact(io_fd, &j, sizeof(unsigned int)) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (6a)"); - goto out; - } -@@ -1863,6 +1918,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - { - if ( wrexact(io_fd, &pfntab, sizeof(unsigned long)*j) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (6b)"); - goto out; - } -@@ -1873,6 +1929,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( xc_vcpu_getcontext(xch, dom, 0, &ctxt) ) - { -+ errnoval = errno; - PERROR("Could not get vcpu context"); - goto out; - } -@@ -1888,6 +1945,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - mfn = GET_FIELD(&ctxt, user_regs.edx); - if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) ) - { -+ errnoval = ERANGE; - ERROR("Suspend record is not in range of pseudophys map"); - goto out; - } -@@ -1900,6 +1958,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - - if ( (i != 0) && xc_vcpu_getcontext(xch, dom, i, &ctxt) ) - { -+ errnoval = errno; - PERROR("No context for VCPU%d", i); - goto out; - } -@@ -1910,6 +1969,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - mfn = GET_FIELD(&ctxt, gdt_frames[j]); - if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) ) - { -+ errnoval = ERANGE; - ERROR("GDT frame is not in range of pseudophys map"); - goto out; - } -@@ -1920,6 +1980,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( !MFN_IS_IN_PSEUDOPHYS_MAP(UNFOLD_CR3( - GET_FIELD(&ctxt, ctrlreg[3]))) ) - { -+ errnoval = ERANGE; - ERROR("PT base is not in range of pseudophys map"); - goto out; - } -@@ -1931,6 +1992,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - { - if ( !MFN_IS_IN_PSEUDOPHYS_MAP(UNFOLD_CR3(ctxt.x64.ctrlreg[1])) ) - { -+ errnoval = ERANGE; - ERROR("PT base is not in range of pseudophys map"); - goto out; - } -@@ -1943,6 +2005,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - ? sizeof(ctxt.x64) - : sizeof(ctxt.x32))) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (1)"); - goto out; - } -@@ -1953,11 +2016,13 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - domctl.u.ext_vcpucontext.vcpu = i; - if ( xc_domctl(xch, &domctl) < 0 ) - { -+ errnoval = errno; - PERROR("No extended context for VCPU%d", i); - goto out; - } - if ( wrexact(io_fd, &domctl.u.ext_vcpucontext, 128) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (2)"); - goto out; - } -@@ -1971,6 +2036,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - domctl.u.vcpuextstate.size = 0; - if ( xc_domctl(xch, &domctl) < 0 ) - { -+ errnoval = errno; - PERROR("No eXtended states (XSAVE) for VCPU%d", i); - goto out; - } -@@ -1982,6 +2048,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - buffer = xc_hypercall_buffer_alloc(xch, buffer, domctl.u.vcpuextstate.size); - if ( !buffer ) - { -+ errnoval = errno; - PERROR("Insufficient memory for getting eXtended states for" - "VCPU%d", i); - goto out; -@@ -1989,6 +2056,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - set_xen_guest_handle(domctl.u.vcpuextstate.buffer, buffer); - if ( xc_domctl(xch, &domctl) < 0 ) - { -+ errnoval = errno; - PERROR("No eXtended states (XSAVE) for VCPU%d", i); - xc_hypercall_buffer_free(xch, buffer); - goto out; -@@ -2000,6 +2068,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - sizeof(domctl.u.vcpuextstate.size)) || - wrexact(io_fd, buffer, domctl.u.vcpuextstate.size) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file VCPU extended state"); - xc_hypercall_buffer_free(xch, buffer); - goto out; -@@ -2015,6 +2084,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - arch.pfn_to_mfn_frame_list_list, 0); - if ( wrexact(io_fd, page, PAGE_SIZE) ) - { -+ errnoval = errno; - PERROR("Error when writing to state file (1)"); - goto out; - } -@@ -2022,6 +2092,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - /* Flush last write and check for errors. */ - if ( fsync(io_fd) && errno != EINVAL ) - { -+ errnoval = errno; - PERROR("Error when flushing state file"); - goto out; - } -@@ -2043,6 +2114,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - ob = &ob_pagebuf; - if (wrcompressed(io_fd) < 0) - { -+ errnoval = errno; - ERROR("Error when writing compressed data, after postcopy\n"); - rc = 1; - goto out; -@@ -2051,6 +2123,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( wrexact(io_fd, ob_tailbuf.buf, ob_tailbuf.pos) ) - { - rc = 1; -+ errnoval = errno; - PERROR("Error when copying tailbuf into outbuf"); - goto out; - } -@@ -2079,6 +2152,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - if ( suspend_and_state(callbacks->suspend, callbacks->data, xch, - io_fd, dom, &info) ) - { -+ errnoval = errno; - ERROR("Domain appears not to have suspended"); - goto out; - } -@@ -2130,7 +2204,9 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter - free(hvm_buf); - outbuf_free(&ob_pagebuf); - -- DPRINTF("Save exit of domid %u with rc=%d\n", dom, rc); -+exit: -+ DPRINTF("Save exit of domid %u with rc=%d, errno=%d\n", dom, rc, errnoval); -+ errno = errnoval; - - return !!rc; - } diff --git a/libxen_permissive.patch b/libxen_permissive.patch deleted file mode 100644 index 16b32e3..0000000 --- a/libxen_permissive.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: xen-4.2.0-testing/tools/libxen/src/xen_common.c -=================================================================== ---- xen-4.2.0-testing.orig/tools/libxen/src/xen_common.c -+++ xen-4.2.0-testing/tools/libxen/src/xen_common.c -@@ -904,8 +904,15 @@ static void parse_into(xen_session *s, x - 0 != strcmp((char *)value_node->children->name, "struct") || - value_node->children->children == NULL) - { -+#if PERMISSIVE -+ fprintf(stderr, -+ "Expected Map from the server, but didn't get one\n"); -+ ((arbitrary_map **)value)[slot] = NULL; -+#else -+ - server_error(s, - "Expected Map from the server, but didn't get it"); -+#endif - } - else - { diff --git a/libxl.add-option-for-discard-support-to-xl-disk-conf.patch b/libxl.add-option-for-discard-support-to-xl-disk-conf.patch deleted file mode 100644 index 5fa6696..0000000 --- a/libxl.add-option-for-discard-support-to-xl-disk-conf.patch +++ /dev/null @@ -1,130 +0,0 @@ -References: FATE#316071 -Subject: libxl: add option for discard support to xl disk configuration - -Handle new boolean option discard/no-discard for disk configuration. It -is supposed to disable discard support if file based backing storage was -intentionally created non-sparse to avoid fragmentation of the file. - -The option intended for the backend driver. A new boolean property -"discard-enable" is written to the backend node. An upcoming patch for -qemu will make use of this property. The kernel blkback driver may be -updated as well to disable discard for phy based backing storage. - -This change does not break ABI. Instead of adding a new member -discard_enable to struct libxl_device_disk the existing readwrite member -is reused. - -Signed-off-by: Olaf Hering ---- - docs/misc/xl-disk-configuration.txt | 17 +++++++++++++++++ - tools/libxl/libxl.c | 2 ++ - tools/libxl/libxl.h | 12 ++++++++++++ - tools/libxl/libxlu_disk.c | 3 +++ - tools/libxl/libxlu_disk_i.h | 2 +- - tools/libxl/libxlu_disk_l.l | 2 ++ - 6 files changed, 37 insertions(+), 1 deletion(-) - -Index: xen-4.4.0-testing/docs/misc/xl-disk-configuration.txt -=================================================================== ---- xen-4.4.0-testing.orig/docs/misc/xl-disk-configuration.txt -+++ xen-4.4.0-testing/docs/misc/xl-disk-configuration.txt -@@ -179,6 +179,23 @@ These scripts are normally called "block - - - -+discard / no-discard -+--------------- -+ -+Description: Request backend to advertise discard support to frontend -+Supported values: discard -+ no-discard -+Mandatory: No -+Default value: discard -+ -+An advisory setting for the backend driver, specifying whether, to -+advertise discard support (TRIM, UNMAP) to the frontend. The real -+benefit of this option is to be able to force it off rather than on. It -+can be used to disable "hole punching" for file based backends which -+were intentionally created non-sparse to avoid fragmentation of the -+file. -+ -+ - ============================================ - DEPRECATED PARAMETERS, PREFIXES AND SYNTAXES - ============================================ -Index: xen-4.4.0-testing/tools/libxl/libxl.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxl.c -+++ xen-4.4.0-testing/tools/libxl/libxl.c -@@ -2484,6 +2484,8 @@ static void device_disk_add(libxl__egc * - flexarray_append(back, disk->readwrite ? "w" : "r"); - flexarray_append(back, "device-type"); - flexarray_append(back, disk->is_cdrom ? "cdrom" : "disk"); -+ if ((disk->readwrite & ~LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MASK) == LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC) -+ flexarray_append_pair(back, "discard-enable", "0"); - - flexarray_append(front, "backend-id"); - flexarray_append(front, libxl__sprintf(gc, "%d", disk->backend_domid)); -Index: xen-4.4.0-testing/tools/libxl/libxl.h -=================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxl.h -+++ xen-4.4.0-testing/tools/libxl/libxl.h -@@ -95,6 +95,18 @@ - #define LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS 1 - - /* -+ * The libxl_device_disk lacks discard_enable field, disabling discard -+ * is supported without breaking the ABI. This is done by overloading -+ * struct libxl_device_disk->readwrite: -+ * readwrite == 0: disk is readonly, no discard -+ * readwrite == 1: disk is readwrite, backend driver may enable discard -+ * readwrite == MAGIC: disk is readwrite, backend driver should not offer -+ * discard to the frontend driver. -+ */ -+#define LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC 0x00000060U -+#define LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MASK 0xffffff0fU -+ -+/* - * libxl ABI compatibility - * - * The only guarantee which libxl makes regarding ABI compatibility -Index: xen-4.4.0-testing/tools/libxl/libxlu_disk.c -=================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk.c -+++ xen-4.4.0-testing/tools/libxl/libxlu_disk.c -@@ -80,6 +80,9 @@ int xlu_disk_parse(XLU_Config *cfg, - disk->format = LIBXL_DISK_FORMAT_EMPTY; - } - -+ if (disk->readwrite && dpc.disable_discard) -+ disk->readwrite = (disk->readwrite & LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MASK) | LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC; -+ - if (!disk->vdev) { - xlu__disk_err(&dpc,0, "no vdev specified"); - goto x_err; -Index: xen-4.4.0-testing/tools/libxl/libxlu_disk_i.h -=================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk_i.h -+++ xen-4.4.0-testing/tools/libxl/libxlu_disk_i.h -@@ -10,7 +10,7 @@ typedef struct { - void *scanner; - YY_BUFFER_STATE buf; - libxl_device_disk *disk; -- int access_set, had_depr_prefix; -+ int access_set, disable_discard, had_depr_prefix; - const char *spec; - } DiskParseContext; - -Index: xen-4.4.0-testing/tools/libxl/libxlu_disk_l.l -=================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk_l.l -+++ xen-4.4.0-testing/tools/libxl/libxlu_disk_l.l -@@ -173,6 +173,8 @@ backendtype=[^,]*,? { STRIP(','); setbac - - vdev=[^,]*,? { STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); } - script=[^,]*,? { STRIP(','); SAVESTRING("script", script, FROMEQUALS); } -+discard,? { DPC->disable_discard = 0; } -+no-discard,? { DPC->disable_discard = 1; } - - /* the target magic parameter, eats the rest of the string */ - diff --git a/libxl.add-option-to-disable-disk-cache-flushes-in-qdisk.patch b/libxl.add-option-to-disable-disk-cache-flushes-in-qdisk.patch index 36536a1..2f80606 100644 --- a/libxl.add-option-to-disable-disk-cache-flushes-in-qdisk.patch +++ b/libxl.add-option-to-disable-disk-cache-flushes-in-qdisk.patch @@ -7,25 +7,25 @@ https://bugzilla.novell.com/show_bug.cgi?id=879425 tools/libxl/libxlu_disk_l.l | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) -Index: xen-4.4.0-testing/tools/libxl/libxl.c +Index: xen-4.5.0-testing/tools/libxl/libxl.c =================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxl.c -+++ xen-4.4.0-testing/tools/libxl/libxl.c -@@ -2488,6 +2488,8 @@ static void device_disk_add(libxl__egc * - flexarray_append_pair(back, "direct-io-safe", "1"); - if ((disk->readwrite & ~LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MASK) == LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC) - flexarray_append_pair(back, "discard-enable", "0"); +--- xen-4.5.0-testing.orig/tools/libxl/libxl.c ++++ xen-4.5.0-testing/tools/libxl/libxl.c +@@ -2771,6 +2771,8 @@ static void device_disk_add(libxl__egc * + flexarray_append_pair(back, "discard-enable", + libxl_defbool_val(disk->discard_enable) ? + "1" : "0"); + if ((disk->readwrite & ~LIBXL_HAVE_LIBXL_DEVICE_DISK_DISABLE_FLUSH_MASK) == LIBXL_HAVE_LIBXL_DEVICE_DISK_DISABLE_FLUSH_MAGIC) + flexarray_append_pair(back, "suse-diskcache-disable-flush", "1"); flexarray_append(front, "backend-id"); flexarray_append(front, libxl__sprintf(gc, "%d", disk->backend_domid)); -Index: xen-4.4.0-testing/tools/libxl/libxl.h +Index: xen-4.5.0-testing/tools/libxl/libxl.h =================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxl.h -+++ xen-4.4.0-testing/tools/libxl/libxl.h -@@ -118,6 +118,18 @@ - #define LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MASK 0xffffff0fU +--- xen-4.5.0-testing.orig/tools/libxl/libxl.h ++++ xen-4.5.0-testing/tools/libxl/libxl.h +@@ -163,6 +163,18 @@ + #define LIBXL_HAVE_BUILDINFO_HVM_MMIO_HOLE_MEMKB 1 /* + * The libxl_device_disk has no way to indicate that cache=unsafe is @@ -43,40 +43,40 @@ Index: xen-4.4.0-testing/tools/libxl/libxl.h * libxl ABI compatibility * * The only guarantee which libxl makes regarding ABI compatibility -Index: xen-4.4.0-testing/tools/libxl/libxlu_disk.c +Index: xen-4.5.0-testing/tools/libxl/libxlu_disk.c =================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk.c -+++ xen-4.4.0-testing/tools/libxl/libxlu_disk.c -@@ -84,6 +84,8 @@ int xlu_disk_parse(XLU_Config *cfg, - disk->readwrite = (disk->readwrite & LIBXL_HAVE_LIBXL_DEVICE_DISK_DIRECT_IO_SAFE_MASK) | LIBXL_HAVE_LIBXL_DEVICE_DISK_DIRECT_IO_SAFE_MAGIC; - if (disk->readwrite && dpc.disable_discard) - disk->readwrite = (disk->readwrite & LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MASK) | LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_DISABLE_MAGIC; +--- xen-4.5.0-testing.orig/tools/libxl/libxlu_disk.c ++++ xen-4.5.0-testing/tools/libxl/libxlu_disk.c +@@ -79,6 +79,8 @@ int xlu_disk_parse(XLU_Config *cfg, + if (!disk->pdev_path || !strcmp(disk->pdev_path, "")) + disk->format = LIBXL_DISK_FORMAT_EMPTY; + } + if (disk->readwrite && dpc.suse_diskcache_disable_flush) + disk->readwrite = (disk->readwrite & LIBXL_HAVE_LIBXL_DEVICE_DISK_DISABLE_FLUSH_MASK) | LIBXL_HAVE_LIBXL_DEVICE_DISK_DISABLE_FLUSH_MAGIC; if (!disk->vdev) { xlu__disk_err(&dpc,0, "no vdev specified"); -Index: xen-4.4.0-testing/tools/libxl/libxlu_disk_i.h +Index: xen-4.5.0-testing/tools/libxl/libxlu_disk_i.h =================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk_i.h -+++ xen-4.4.0-testing/tools/libxl/libxlu_disk_i.h +--- xen-4.5.0-testing.orig/tools/libxl/libxlu_disk_i.h ++++ xen-4.5.0-testing/tools/libxl/libxlu_disk_i.h @@ -10,7 +10,7 @@ typedef struct { void *scanner; YY_BUFFER_STATE buf; libxl_device_disk *disk; -- int access_set, direct_io_safe, disable_discard, had_depr_prefix; -+ int access_set, suse_diskcache_disable_flush, direct_io_safe, disable_discard, had_depr_prefix; +- int access_set, had_depr_prefix; ++ int access_set, suse_diskcache_disable_flush, had_depr_prefix; const char *spec; } DiskParseContext; -Index: xen-4.4.0-testing/tools/libxl/libxlu_disk_l.l +Index: xen-4.5.0-testing/tools/libxl/libxlu_disk_l.l =================================================================== ---- xen-4.4.0-testing.orig/tools/libxl/libxlu_disk_l.l -+++ xen-4.4.0-testing/tools/libxl/libxlu_disk_l.l +--- xen-4.5.0-testing.orig/tools/libxl/libxlu_disk_l.l ++++ xen-4.5.0-testing/tools/libxl/libxlu_disk_l.l @@ -176,6 +176,7 @@ script=[^,]*,? { STRIP(','); SAVESTRING( - direct-io-safe,? { DPC->direct_io_safe = 1; } - discard,? { DPC->disable_discard = 0; } - no-discard,? { DPC->disable_discard = 1; } + direct-io-safe,? { DPC->disk->direct_io_safe = 1; } + discard,? { libxl_defbool_set(&DPC->disk->discard_enable, true); } + no-discard,? { libxl_defbool_set(&DPC->disk->discard_enable, false); } +suse-diskcache-disable-flush,? { DPC->suse_diskcache_disable_flush = 1; } /* the target magic parameter, eats the rest of the string */ diff --git a/libxl.honor-more-top-level-vfb-options.patch b/libxl.honor-more-top-level-vfb-options.patch deleted file mode 100644 index f3991bc..0000000 --- a/libxl.honor-more-top-level-vfb-options.patch +++ /dev/null @@ -1,77 +0,0 @@ -From: Wei Liu -Date: Tue, 28 Jan 2014 15:38:01 +0000 -Subject: xl: honor more top level vfb options - -Now that SDL and keymap options for VFB can also be specified in top -level options. Documentation is also updated. - -This fixes bug #31 and further possible problems. - -Signed-off-by: Wei Liu -Cc: Olaf Hering -Cc: Ian Campbell -Cc: Ian Jackson ---- - docs/man/xl.cfg.pod.5 | 4 ++-- - tools/libxl/xl_cmdimpl.c | 17 ++++++++++++++--- - 2 files changed, 16 insertions(+), 5 deletions(-) - -Index: xen-4.4.1-testing/docs/man/xl.cfg.pod.5 -=================================================================== ---- xen-4.4.1-testing.orig/docs/man/xl.cfg.pod.5 -+++ xen-4.4.1-testing/docs/man/xl.cfg.pod.5 -@@ -420,8 +420,8 @@ This options does not control the emulat - an HVM guest. See L below for how to - configure the emulated device. If L options - are used in a PV guest configuration, xl will pick up B, B, --B, B and B to construct paravirtual --framebuffer device for the guest. -+B, B, B, B, B and -+B to construct paravirtual framebuffer device for the guest. - - Each B is a comma-separated list of C - settings, from the following list: -Index: xen-4.4.1-testing/tools/libxl/xl_cmdimpl.c -=================================================================== ---- xen-4.4.1-testing.orig/tools/libxl/xl_cmdimpl.c -+++ xen-4.4.1-testing/tools/libxl/xl_cmdimpl.c -@@ -721,6 +721,15 @@ static void parse_top_level_vnc_options( - xlu_cfg_get_defbool(config, "vncunused", &vnc->findunused, 0); - } - -+static void parse_top_level_sdl_options(XLU_Config *config, -+ libxl_sdl_info *sdl) -+{ -+ xlu_cfg_get_defbool(config, "sdl", &sdl->enable, 0); -+ xlu_cfg_get_defbool(config, "opengl", &sdl->opengl, 0); -+ xlu_cfg_replace_string (config, "display", &sdl->display, 0); -+ xlu_cfg_replace_string (config, "xauthority", &sdl->xauthority, 0); -+} -+ - static char *parse_cmdline(XLU_Config *config) - { - char *cmdline = NULL; -@@ -1666,9 +1675,13 @@ skip_vfb: - libxl_device_vkb_init); - - parse_top_level_vnc_options(config, &vfb->vnc); -+ parse_top_level_sdl_options(config, &vfb->sdl); -+ xlu_cfg_replace_string (config, "keymap", &vfb->keymap, 0); - } -- } else -+ } else { - parse_top_level_vnc_options(config, &b_info->u.hvm.vnc); -+ parse_top_level_sdl_options(config, &b_info->u.hvm.sdl); -+ } - - if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) { - if (!xlu_cfg_get_string (config, "vga", &buf, 0)) { -@@ -1685,8 +1698,6 @@ skip_vfb: - LIBXL_VGA_INTERFACE_TYPE_CIRRUS; - - xlu_cfg_replace_string (config, "keymap", &b_info->u.hvm.keymap, 0); -- xlu_cfg_get_defbool(config, "sdl", &b_info->u.hvm.sdl.enable, 0); -- xlu_cfg_get_defbool(config, "opengl", &b_info->u.hvm.sdl.opengl, 0); - xlu_cfg_get_defbool (config, "spice", &b_info->u.hvm.spice.enable, 0); - if (!xlu_cfg_get_long (config, "spiceport", &l, 0)) - b_info->u.hvm.spice.port = l; diff --git a/libxl.introduce-an-option-to-disable-the-non-O_DIRECT-workaround.patch b/libxl.introduce-an-option-to-disable-the-non-O_DIRECT-workaround.patch deleted file mode 100644 index 999ac88..0000000 --- a/libxl.introduce-an-option-to-disable-the-non-O_DIRECT-workaround.patch +++ /dev/null @@ -1,203 +0,0 @@ -xen-unstable commit 6ec48cf41b6656c98148380f39010063e62628c5 -Frp,: Stefano Stabellini -Date: Wed Apr 30 16:06:24 2014 +0100 -Subject: libxl: introduce an option for disabling the non-O_DIRECT workaround - -Document and implement a new option that permits disk backends which -would otherwise have to avoid O_DIRECT (because of the network memory -lifetime bug) to use it anyway. This is: - direct-io-safe in the xl domain disk config specification - direct_io_safe in the libxl disk API - direct-io-safe in the backend xenstore interface - -Add a reference to xen/include/public/io/blkif.h in -docs/misc/vbd-interface.txt. - -This change does not break ABI. Instead of adding a new member -direct_io_safe to struct libxl_device_disk the existing readwrite member -is reused. - -Signed-off-by: Stefano Stabellini -Signed-off-by: Ian Jackson -Acked-by: Ian Campbell -Tested-by: Felipe Franciosi ---- - docs/misc/vbd-interface.txt | 6 +++++ - docs/misc/xl-disk-configuration.txt | 38 ++++++++++++++++++++++++++++++++++++ - tools/libxl/libxl.c | 2 + - tools/libxl/libxl.h | 11 ++++++++++ - tools/libxl/libxlu_disk.c | 2 + - tools/libxl/libxlu_disk_i.h | 2 - - tools/libxl/libxlu_disk_l.l | 1 - xen/include/public/io/blkif.h | 22 ++++++++++++++++++++ - 8 files changed, 83 insertions(+), 1 deletion(-) - -Index: xen-4.4.0-testing/docs/misc/vbd-interface.txt -=================================================================== ---- xen-4.4.0-testing.orig/docs/misc/vbd-interface.txt -+++ xen-4.4.0-testing/docs/misc/vbd-interface.txt -@@ -125,3 +125,9 @@ because they directly map the bottom 8 b - directly to the Linux guest's device number and throw away the rest; - they can crash due to minor number clashes. With these guests, the - workaround is not to supply problematic combinations of devices. -+ -+ -+Other frontend and backend options -+---------------------------------- -+ -+See xen/include/public/io/blkif.h for the full list of options. -Index: xen-4.4.0-testing/docs/misc/xl-disk-configuration.txt -=================================================================== ---- xen-4.4.0-testing.orig/docs/misc/xl-disk-configuration.txt -+++ xen-4.4.0-testing/docs/misc/xl-disk-configuration.txt -@@ -178,6 +178,44 @@ information to be interpreted by the exe - These scripts are normally called "block-