From 54963fbc09e172fcb1b88466acff72e25f9ce6483fa634cfbabe7501570d9db4 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 13 Oct 2008 21:48:54 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xen?expand=0&rev=56 --- 18588-do-get-pm-info.patch | 39 +++++++++++++++++++++++++++++++ blktap-ioemu-close-fix.patch | 21 +++++++++++++++++ blktapctrl-default-to-ioemu.patch | 27 +++++++++++++++------ tapdisk-ioemu-logfile.patch | 3 ++- x86-alloc-cpu-structs.patch | 20 ++++++++-------- x86-page-table-return-fix.patch | 19 +++++++++++++++ xen-3.3.1-testing-src.tar.bz2 | 4 ++-- xen.changes | 14 +++++++++++ xen.spec | 22 +++++++++++++---- 9 files changed, 145 insertions(+), 24 deletions(-) create mode 100644 18588-do-get-pm-info.patch create mode 100644 blktap-ioemu-close-fix.patch create mode 100644 x86-page-table-return-fix.patch diff --git a/18588-do-get-pm-info.patch b/18588-do-get-pm-info.patch new file mode 100644 index 0000000..70db49b --- /dev/null +++ b/18588-do-get-pm-info.patch @@ -0,0 +1,39 @@ +# HG changeset patch +# User Keir Fraser +# Date 1223629254 -3600 +# Node ID a175b2c039ed2481e4064a8256bd29f15c98d0d1 +# Parent 8f5a67f466e297535f84cc88eaaa2e71f37f2963 +acpi/pmstat.c: refer to the array after range check. + +Signed-off-by: Isaku Yamahata + +Index: xen-3.3.1-testing/xen/arch/x86/acpi/pmstat.c +=================================================================== +--- xen-3.3.1-testing.orig/xen/arch/x86/acpi/pmstat.c ++++ xen-3.3.1-testing/xen/arch/x86/acpi/pmstat.c +@@ -49,17 +49,20 @@ extern int pmstat_reset_cx_stat(uint32_t + int do_get_pm_info(struct xen_sysctl_get_pmstat *op) + { + int ret = 0; +- struct pm_px *pxpt = &px_statistic_data[op->cpuid]; +- struct processor_pminfo *pmpt = &processor_pminfo[op->cpuid]; ++ struct pm_px *pxpt; ++ const struct processor_pminfo *pmpt; ++ ++ if ( (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) ) ++ return -EINVAL; ++ ++ pmpt = processor_pminfo[op->cpuid]; ++ pxpt = &px_statistic_data[op->cpuid]; + + /* to protect the case when Px was not controlled by xen */ + if ( (!(pmpt->perf.init & XEN_PX_INIT)) && + (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX ) + return -EINVAL; + +- if ( !cpu_online(op->cpuid) ) +- return -EINVAL; +- + switch( op->type ) + { + case PMSTAT_get_max_px: diff --git a/blktap-ioemu-close-fix.patch b/blktap-ioemu-close-fix.patch new file mode 100644 index 0000000..e4fe6fe --- /dev/null +++ b/blktap-ioemu-close-fix.patch @@ -0,0 +1,21 @@ +Index: xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c +=================================================================== +--- xen-3.3.1-testing.orig/tools/blktap/drivers/blktapctrl.c ++++ xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c +@@ -245,8 +245,15 @@ static int del_disktype(blkif_t *blkif) + DPRINTF("DEL_DISKTYPE: Freeing entry\n"); + free(entry); + ++#ifdef ALWAYS_USE_IOEMU ++ return 0; ++#else + /* Caller should close() if no single controller, or list is empty. */ +- return (!dtypes[type]->single_handler || (active_disks[type] == NULL)); ++ /* tapdisk-ioemu is a single controller regardless of single_hander ++ (TODO: This needs to be per-domain in fact) */ ++ return ((!dtypes[type]->single_handler && !dtypes[type]->use_ioemu) ++ || (active_disks[type] == NULL)); ++#endif + } + + static int write_msg(int fd, int msgtype, void *ptr, void *ptr2) diff --git a/blktapctrl-default-to-ioemu.patch b/blktapctrl-default-to-ioemu.patch index a8c7fda..0995aa9 100644 --- a/blktapctrl-default-to-ioemu.patch +++ b/blktapctrl-default-to-ioemu.patch @@ -53,7 +53,17 @@ Index: xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c static int launch_tapdisk_ioemu(void) { -@@ -524,7 +531,7 @@ static int connect_qemu(blkif_t *blkif, +@@ -505,7 +512,8 @@ static int connect_qemu(blkif_t *blkif, + static int tapdisk_ioemu_pid = 0; + static int dom0_readfd = 0; + static int dom0_writefd = 0; +- ++ int refresh_pid = 0; ++ + if (asprintf(&rdctldev, BLKTAP_CTRL_DIR "/qemu-read-%d", domid) < 0) + return -1; + +@@ -524,15 +532,23 @@ static int connect_qemu(blkif_t *blkif, if (tapdisk_ioemu_pid == 0 || kill(tapdisk_ioemu_pid, 0)) { /* No device model and tapdisk-ioemu doesn't run yet */ DPRINTF("Launching tapdisk-ioemu\n"); @@ -62,12 +72,15 @@ Index: xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c dom0_readfd = open_ctrl_socket(wrctldev); dom0_writefd = open_ctrl_socket(rdctldev); -@@ -533,6 +540,12 @@ static int connect_qemu(blkif_t *blkif, ++ ++ refresh_pid = 1; + } + DPRINTF("Using tapdisk-ioemu connection\n"); blkif->fds[READ] = dom0_readfd; blkif->fds[WRITE] = dom0_writefd; + -+ if (tapdisk_ioemu_pid == 0) { ++ if (refresh_pid) { + get_tapdisk_pid(blkif); + tapdisk_ioemu_pid = blkif->tappid; + } @@ -75,7 +88,7 @@ Index: xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c } else if (access(rdctldev, R_OK | W_OK) == 0) { /* Use existing pipe to the device model */ DPRINTF("Using qemu-dm connection\n"); -@@ -554,6 +567,7 @@ static int connect_qemu(blkif_t *blkif, +@@ -554,6 +570,7 @@ static int connect_qemu(blkif_t *blkif, return 0; } @@ -83,7 +96,7 @@ Index: xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c /* Launch tapdisk instance */ static int connect_tapdisk(blkif_t *blkif, int minor) { -@@ -597,6 +611,7 @@ fail: +@@ -597,6 +614,7 @@ fail: return ret; } @@ -91,7 +104,7 @@ Index: xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c static int blktapctrl_new_blkif(blkif_t *blkif) { -@@ -606,13 +621,14 @@ static int blktapctrl_new_blkif(blkif_t +@@ -606,13 +624,14 @@ static int blktapctrl_new_blkif(blkif_t image_t *image; blkif_t *exist = NULL; static uint16_t next_cookie = 0; @@ -107,7 +120,7 @@ Index: xen-3.3.1-testing/tools/blktap/drivers/blktapctrl.c DPRINTF("Error in blktap device string(%s).\n", blk->params); goto fail; -@@ -621,13 +637,18 @@ static int blktapctrl_new_blkif(blkif_t +@@ -621,13 +640,18 @@ static int blktapctrl_new_blkif(blkif_t blkif->cookie = next_cookie++; if (!exist) { diff --git a/tapdisk-ioemu-logfile.patch b/tapdisk-ioemu-logfile.patch index 936d9f4..cf7e019 100644 --- a/tapdisk-ioemu-logfile.patch +++ b/tapdisk-ioemu-logfile.patch @@ -2,7 +2,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/tapdisk-ioemu.c =================================================================== --- xen-3.3.1-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c +++ xen-3.3.1-testing/tools/ioemu-remote/tapdisk-ioemu.c -@@ -100,16 +100,22 @@ int main(void) +@@ -100,16 +100,23 @@ int main(void) struct timeval tv; void *old_fd_start = NULL; @@ -22,6 +22,7 @@ Index: xen-3.3.1-testing/tools/ioemu-remote/tapdisk-ioemu.c - + logfile = fopen("/var/log/xen/tapdisk-ioemu.log", "a"); + if (logfile) { ++ setbuf(logfile, NULL); + fclose(stderr); + stderr = logfile; + } else { diff --git a/x86-alloc-cpu-structs.patch b/x86-alloc-cpu-structs.patch index 2632404..4a8050e 100644 --- a/x86-alloc-cpu-structs.patch +++ b/x86-alloc-cpu-structs.patch @@ -336,13 +336,18 @@ Index: xen-3.3.1-testing/xen/arch/x86/acpi/pmstat.c extern uint32_t pmstat_get_cx_nr(uint32_t cpuid); extern int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat); -@@ -49,15 +49,14 @@ extern int pmstat_reset_cx_stat(uint32_t +@@ -49,17 +49,15 @@ extern int pmstat_reset_cx_stat(uint32_t int do_get_pm_info(struct xen_sysctl_get_pmstat *op) { int ret = 0; -- struct pm_px *pxpt = &px_statistic_data[op->cpuid]; -- struct processor_pminfo *pmpt = &processor_pminfo[op->cpuid]; -+ const struct processor_pminfo *pmpt = processor_pminfo[op->cpuid]; +- struct pm_px *pxpt; + const struct processor_pminfo *pmpt; + + if ( (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) ) + return -EINVAL; + + pmpt = processor_pminfo[op->cpuid]; +- pxpt = &px_statistic_data[op->cpuid]; /* to protect the case when Px was not controlled by xen */ - if ( (!(pmpt->perf.init & XEN_PX_INIT)) && @@ -350,12 +355,7 @@ Index: xen-3.3.1-testing/xen/arch/x86/acpi/pmstat.c (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX ) return -EINVAL; -- if ( !cpu_online(op->cpuid) ) -+ if ( op->cpuid >= NR_CPUS || !cpu_online(op->cpuid) ) - return -EINVAL; - - switch( op->type ) -@@ -73,6 +72,10 @@ int do_get_pm_info(struct xen_sysctl_get +@@ -76,6 +74,10 @@ int do_get_pm_info(struct xen_sysctl_get uint64_t now, ct; uint64_t total_idle_ns; uint64_t tmp_idle_ns; diff --git a/x86-page-table-return-fix.patch b/x86-page-table-return-fix.patch new file mode 100644 index 0000000..7be50da --- /dev/null +++ b/x86-page-table-return-fix.patch @@ -0,0 +1,19 @@ +A blatant mistake of mine resulted in the return value of alloc_l1_table to +be ignored with the preemptable page table update changes. + +Signed-off-by: Jan Beulich + +Index: 2008-09-19/xen/arch/x86/mm.c +=================================================================== +--- 2008-09-19.orig/xen/arch/x86/mm.c 2008-09-19 14:00:01.000000000 +0200 ++++ 2008-09-19/xen/arch/x86/mm.c 2008-10-13 12:07:13.000000000 +0200 +@@ -1883,8 +1883,7 @@ static int alloc_page_type(struct page_i + switch ( type & PGT_type_mask ) + { + case PGT_l1_page_table: +- alloc_l1_table(page); +- rc = 0; ++ rc = alloc_l1_table(page); + break; + case PGT_l2_page_table: + rc = alloc_l2_table(page, type, preemptible); diff --git a/xen-3.3.1-testing-src.tar.bz2 b/xen-3.3.1-testing-src.tar.bz2 index d2aaf4d..beada7d 100644 --- a/xen-3.3.1-testing-src.tar.bz2 +++ b/xen-3.3.1-testing-src.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ad242249f77ef42e323e81cbd61afcac37eaa93749a8fe7d5aec2cf4048768ba -size 22688600 +oid sha256:bbc40412e65f50bdfae0f38d8ea3f51b8df773ffea6cd105988729fe470b4a67 +size 22689575 diff --git a/xen.changes b/xen.changes index da442dd..e776eeb 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Mon Oct 13 10:51:51 MDT 2008 - carnold@novell.com + +- bnc#431324 - Cannot boot from XEN kernel + +------------------------------------------------------------------- +Mon Oct 13 14:27:35 CEST 2008 - kwolf@suse.de + +- blktapctrl: Close connection to tapdisk-ioemu only if there are + no more attached disks + blktap-ioemu-close-fix.patch +- blktapctrl: If tapdisk-ioemu has been shut down and a new + instance is needed, fix saving the PID of the new instance + ------------------------------------------------------------------- Thu Oct 2 16:23:15 MDT 2008 - jfehlig@novell.com diff --git a/xen.spec b/xen.spec index 49af0b6..7cef283 100644 --- a/xen.spec +++ b/xen.spec @@ -1,5 +1,5 @@ # -# spec file for package xen (Version 3.3.1_18442_01) +# spec file for package xen (Version 3.3.1_18447_01) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -21,7 +21,7 @@ Name: xen %define xvers 3.3 %define xvermaj 3 -%define changeset 18442 +%define changeset 18447 %define xen_build_dir xen-3.3.1-testing %if %sles_version %define with_kmp 1 @@ -40,7 +40,7 @@ BuildRequires: glibc-32bit glibc-devel-32bit %if %{?with_kmp}0 BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11 %endif -Version: 3.3.1_18442_01 +Version: 3.3.1_18447_01 Release: 1 License: GPL v2 only Group: System/Kernel @@ -85,7 +85,8 @@ Patch12: 18509-continue-hypercall-on-cpu.patch Patch13: 18520-per-CPU-GDT.patch Patch14: 18521-per-CPU-TSS.patch Patch15: 18523-per-CPU-misc.patch -Patch16: xenstore-leak.patch +Patch16: 18588-do-get-pm-info.patch +Patch17: xenstore-leak.patch # Our patches Patch100: xen-config.diff Patch101: xend-config.diff @@ -146,6 +147,7 @@ Patch182: build-tapdisk-ioemu.patch Patch183: blktapctrl-default-to-ioemu.patch Patch184: ioemu-blktap-barriers.patch Patch185: tapdisk-ioemu-logfile.patch +Patch186: blktap-ioemu-close-fix.patch # Jim's domain lock patch Patch190: xend-domain-lock.patch # Patches from Jan @@ -154,6 +156,7 @@ Patch241: x86-show-page-walk-early.patch Patch242: svm-lmsl.patch Patch243: x86-extra-trap-info.patch Patch244: x86-alloc-cpu-structs.patch +Patch245: x86-page-table-return-fix.patch Patch250: 32on64-extra-mem.patch Patch251: msi-enable.patch # PV Driver Patches @@ -513,6 +516,7 @@ Authors: %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 %patch100 -p1 %patch101 -p1 %patch102 -p1 @@ -570,12 +574,14 @@ Authors: %patch183 -p1 %patch184 -p1 %patch185 -p1 +%patch186 -p1 %patch190 -p1 %patch240 -p1 %patch241 -p1 %patch242 -p1 %patch243 -p1 %patch244 -p1 +%patch245 -p1 %patch250 -p1 %patch251 -p1 %patch350 -p1 @@ -932,6 +938,14 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug /sbin/ldconfig %changelog +* Mon Oct 13 2008 carnold@novell.com +- bnc#431324 - Cannot boot from XEN kernel +* Mon Oct 13 2008 kwolf@suse.de +- blktapctrl: Close connection to tapdisk-ioemu only if there are + no more attached disks + blktap-ioemu-close-fix.patch +- blktapctrl: If tapdisk-ioemu has been shut down and a new + instance is needed, fix saving the PID of the new instance * Thu Oct 02 2008 jfehlig@novell.com - bnc#431737 - Fix use of deprecated python constructs in xend * Mon Sep 29 2008 carnold@novell.com