diff --git a/51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch b/51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch new file mode 100644 index 0000000..57bd9a7 --- /dev/null +++ b/51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch @@ -0,0 +1,44 @@ +# Commit 5ad914bc867c5a6a4957869c89918f4e1f9dd9c4 +# Date 2013-07-02 08:48:03 +0200 +# Author Jan Beulich +# Committer Jan Beulich +x86: don't pass negative time to gtime_to_gtsc() (try 2) + +This mostly reverts commit eb60be3d ("x86: don't pass negative time to +gtime_to_gtsc()") and instead corrects __update_vcpu_system_time()'s +handling of this_cpu(cpu_time).stime_local_stamp dating back before the +start of a HVM guest (which would otherwise lead to a negative value +getting passed to gtime_to_gtsc(), causing scale_delta() to produce +meaningless output). + +Flushing the value to zero was wrong, and printing a message for +something that can validly happen wasn't very useful either. + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/xen/arch/x86/time.c ++++ b/xen/arch/x86/time.c +@@ -823,16 +823,13 @@ static void __update_vcpu_system_time(st + struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time; + + stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset; +- if ( (s64)stime < 0 ) +- { +- printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64 +- " (offsets %" PRId64 "/%" PRId64 ")\n", +- d->domain_id, v->vcpu_id, stime, +- pl->stime_offset, v->arch.hvm_vcpu.stime_offset); +- stime = 0; +- } ++ if ( stime >= 0 ) ++ tsc_stamp = gtime_to_gtsc(d, stime); ++ else ++ tsc_stamp = -gtime_to_gtsc(d, -stime); + } +- tsc_stamp = gtime_to_gtsc(d, stime); ++ else ++ tsc_stamp = gtime_to_gtsc(d, stime); + } + else + { diff --git a/51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch b/51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch new file mode 100644 index 0000000..86a467e --- /dev/null +++ b/51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch @@ -0,0 +1,285 @@ +# Commit 2823a0c7dfc979db316787e1dd42a8845e5825c0 +# Date 2013-07-02 08:49:43 +0200 +# Author Suravee Suthikulpanit +# Committer Jan Beulich +iommu/amd: Fix logic for clearing the IOMMU interrupt bits + +The IOMMU interrupt bits in the IOMMU status registers are +"read-only, and write-1-to-clear (RW1C). Therefore, the existing +logic which reads the register, set the bit, and then writing back +the values could accidentally clear certain bits if it has been set. + +The correct logic would just be writing only the value which only +set the interrupt bits, and leave the rest to zeros. + +This patch also, clean up #define masks as Jan has suggested. + +Signed-off-by: Suravee Suthikulpanit + +With iommu_interrupt_handler() properly having got switched its readl() +from status to control register, the subsequent writel() needed to be +switched too (and the RW1C comment there was bogus). + +Some of the cleanup went too far - undone. + +Further, with iommu_interrupt_handler() now actually disabling the +interrupt sources, they also need to get re-enabled by the tasklet once +it finished processing the respective log. This also implies re-running +the tasklet so that log entries added between reading the log and re- +enabling the interrupt will get handled in a timely manner. + +Finally, guest write emulation to the status register needs to be done +with the RW1C (and RO for all other bits) semantics in mind too. + +Signed-off-by: Jan Beulich +Reviewed-by: Tim Deegan +Acked-by: Suravee Suthikulpanit + +--- a/xen/drivers/passthrough/amd/iommu_cmd.c ++++ b/xen/drivers/passthrough/amd/iommu_cmd.c +@@ -75,11 +75,9 @@ static void flush_command_buffer(struct + u32 cmd[4], status; + int loop_count, comp_wait; + +- /* clear 'ComWaitInt' in status register (WIC) */ +- set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, 0, +- IOMMU_STATUS_COMP_WAIT_INT_MASK, +- IOMMU_STATUS_COMP_WAIT_INT_SHIFT, &status); +- writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ /* RW1C 'ComWaitInt' in status register */ ++ writel(IOMMU_STATUS_COMP_WAIT_INT_MASK, ++ iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); + + /* send an empty COMPLETION_WAIT command to flush command buffer */ + cmd[3] = cmd[2] = 0; +@@ -103,9 +101,9 @@ static void flush_command_buffer(struct + + if ( comp_wait ) + { +- /* clear 'ComWaitInt' in status register (WIC) */ +- status &= IOMMU_STATUS_COMP_WAIT_INT_MASK; +- writel(status, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ /* RW1C 'ComWaitInt' in status register */ ++ writel(IOMMU_STATUS_COMP_WAIT_INT_MASK, ++ iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); + return; + } + AMD_IOMMU_DEBUG("Warning: ComWaitInt bit did not assert!\n"); +--- a/xen/drivers/passthrough/amd/iommu_guest.c ++++ b/xen/drivers/passthrough/amd/iommu_guest.c +@@ -754,7 +754,14 @@ static void guest_iommu_mmio_write64(str + u64_to_reg(&iommu->ppr_log.reg_tail, val); + break; + case IOMMU_STATUS_MMIO_OFFSET: +- u64_to_reg(&iommu->reg_status, val); ++ val &= IOMMU_STATUS_EVENT_OVERFLOW_MASK | ++ IOMMU_STATUS_EVENT_LOG_INT_MASK | ++ IOMMU_STATUS_COMP_WAIT_INT_MASK | ++ IOMMU_STATUS_PPR_LOG_OVERFLOW_MASK | ++ IOMMU_STATUS_PPR_LOG_INT_MASK | ++ IOMMU_STATUS_GAPIC_LOG_OVERFLOW_MASK | ++ IOMMU_STATUS_GAPIC_LOG_INT_MASK; ++ u64_to_reg(&iommu->reg_status, reg_to_u64(iommu->reg_status) & ~val); + break; + + default: +--- a/xen/drivers/passthrough/amd/iommu_init.c ++++ b/xen/drivers/passthrough/amd/iommu_init.c +@@ -344,13 +344,13 @@ static void set_iommu_ppr_log_control(st + writeq(0, iommu->mmio_base + IOMMU_PPR_LOG_TAIL_OFFSET); + + iommu_set_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT); +- iommu_set_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT); ++ iommu_set_bit(&entry, IOMMU_CONTROL_PPR_LOG_INT_SHIFT); + iommu_set_bit(&entry, IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT); + } + else + { + iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_ENABLE_SHIFT); +- iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_INT_SHIFT); ++ iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_LOG_INT_SHIFT); + iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT); + } + +@@ -410,7 +410,7 @@ static void iommu_reset_log(struct amd_i + void (*ctrl_func)(struct amd_iommu *iommu, int)) + { + u32 entry; +- int log_run, run_bit, of_bit; ++ int log_run, run_bit; + int loop_count = 1000; + + BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log))); +@@ -419,10 +419,6 @@ static void iommu_reset_log(struct amd_i + IOMMU_STATUS_EVENT_LOG_RUN_SHIFT : + IOMMU_STATUS_PPR_LOG_RUN_SHIFT; + +- of_bit = ( log == &iommu->event_log ) ? +- IOMMU_STATUS_EVENT_OVERFLOW_SHIFT : +- IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT; +- + /* wait until EventLogRun bit = 0 */ + do { + entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); +@@ -439,9 +435,10 @@ static void iommu_reset_log(struct amd_i + + ctrl_func(iommu, IOMMU_CONTROL_DISABLED); + +- /*clear overflow bit */ +- iommu_clear_bit(&entry, of_bit); +- writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ /* RW1C overflow bit */ ++ writel(log == &iommu->event_log ? IOMMU_STATUS_EVENT_OVERFLOW_MASK ++ : IOMMU_STATUS_PPR_LOG_OVERFLOW_MASK, ++ iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); + + /*reset event log base address */ + log->head = 0; +@@ -611,22 +608,33 @@ static void iommu_check_event_log(struct + u32 entry; + unsigned long flags; + ++ /* RW1C interrupt status bit */ ++ writel(IOMMU_STATUS_EVENT_LOG_INT_MASK, ++ iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ + iommu_read_log(iommu, &iommu->event_log, + sizeof(event_entry_t), parse_event_log_entry); + + spin_lock_irqsave(&iommu->lock, flags); + +- /*check event overflow */ ++ /* Check event overflow. */ + entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); +- + if ( iommu_get_bit(entry, IOMMU_STATUS_EVENT_OVERFLOW_SHIFT) ) + iommu_reset_log(iommu, &iommu->event_log, set_iommu_event_log_control); +- +- /* reset interrupt status bit */ +- entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); +- iommu_set_bit(&entry, IOMMU_STATUS_EVENT_LOG_INT_SHIFT); +- +- writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ else ++ { ++ entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET); ++ if ( !(entry & IOMMU_CONTROL_EVENT_LOG_INT_MASK) ) ++ { ++ entry |= IOMMU_CONTROL_EVENT_LOG_INT_MASK; ++ writel(entry, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET); ++ /* ++ * Re-schedule the tasklet to handle eventual log entries added ++ * between reading the log above and re-enabling the interrupt. ++ */ ++ tasklet_schedule(&amd_iommu_irq_tasklet); ++ } ++ } + + spin_unlock_irqrestore(&iommu->lock, flags); + } +@@ -681,22 +689,33 @@ static void iommu_check_ppr_log(struct a + u32 entry; + unsigned long flags; + ++ /* RW1C interrupt status bit */ ++ writel(IOMMU_STATUS_PPR_LOG_INT_MASK, ++ iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ + iommu_read_log(iommu, &iommu->ppr_log, + sizeof(ppr_entry_t), parse_ppr_log_entry); + + spin_lock_irqsave(&iommu->lock, flags); + +- /*check event overflow */ ++ /* Check event overflow. */ + entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); +- + if ( iommu_get_bit(entry, IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT) ) + iommu_reset_log(iommu, &iommu->ppr_log, set_iommu_ppr_log_control); +- +- /* reset interrupt status bit */ +- entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); +- iommu_set_bit(&entry, IOMMU_STATUS_PPR_LOG_INT_SHIFT); +- +- writel(entry, iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ else ++ { ++ entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET); ++ if ( !(entry & IOMMU_CONTROL_PPR_LOG_INT_MASK) ) ++ { ++ entry |= IOMMU_CONTROL_PPR_LOG_INT_MASK; ++ writel(entry, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET); ++ /* ++ * Re-schedule the tasklet to handle eventual log entries added ++ * between reading the log above and re-enabling the interrupt. ++ */ ++ tasklet_schedule(&amd_iommu_irq_tasklet); ++ } ++ } + + spin_unlock_irqrestore(&iommu->lock, flags); + } +@@ -733,11 +752,14 @@ static void iommu_interrupt_handler(int + + spin_lock_irqsave(&iommu->lock, flags); + +- /* Silence interrupts from both event and PPR logging */ +- entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); +- iommu_clear_bit(&entry, IOMMU_STATUS_EVENT_LOG_INT_SHIFT); +- iommu_clear_bit(&entry, IOMMU_STATUS_PPR_LOG_INT_SHIFT); +- writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET); ++ /* ++ * Silence interrupts from both event and PPR by clearing the ++ * enable logging bits in the control register ++ */ ++ entry = readl(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET); ++ iommu_clear_bit(&entry, IOMMU_CONTROL_EVENT_LOG_INT_SHIFT); ++ iommu_clear_bit(&entry, IOMMU_CONTROL_PPR_LOG_INT_SHIFT); ++ writel(entry, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET); + + spin_unlock_irqrestore(&iommu->lock, flags); + +--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h ++++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h +@@ -336,14 +336,17 @@ + #define IOMMU_CONTROL_ISOCHRONOUS_SHIFT 11 + #define IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_MASK 0x00001000 + #define IOMMU_CONTROL_COMMAND_BUFFER_ENABLE_SHIFT 12 ++#define IOMMU_CONTROL_PPR_LOG_ENABLE_MASK 0x00002000 ++#define IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT 13 ++#define IOMMU_CONTROL_PPR_LOG_INT_MASK 0x00004000 ++#define IOMMU_CONTROL_PPR_LOG_INT_SHIFT 14 ++#define IOMMU_CONTROL_PPR_ENABLE_MASK 0x00008000 ++#define IOMMU_CONTROL_PPR_ENABLE_SHIFT 15 ++#define IOMMU_CONTROL_GT_ENABLE_MASK 0x00010000 ++#define IOMMU_CONTROL_GT_ENABLE_SHIFT 16 + #define IOMMU_CONTROL_RESTART_MASK 0x80000000 + #define IOMMU_CONTROL_RESTART_SHIFT 31 + +-#define IOMMU_CONTROL_PPR_LOG_ENABLE_SHIFT 13 +-#define IOMMU_CONTROL_PPR_INT_SHIFT 14 +-#define IOMMU_CONTROL_PPR_ENABLE_SHIFT 15 +-#define IOMMU_CONTROL_GT_ENABLE_SHIFT 16 +- + /* Exclusion Register */ + #define IOMMU_EXCLUSION_BASE_LOW_OFFSET 0x20 + #define IOMMU_EXCLUSION_BASE_HIGH_OFFSET 0x24 +@@ -395,9 +398,18 @@ + #define IOMMU_STATUS_EVENT_LOG_RUN_SHIFT 3 + #define IOMMU_STATUS_CMD_BUFFER_RUN_MASK 0x00000010 + #define IOMMU_STATUS_CMD_BUFFER_RUN_SHIFT 4 ++#define IOMMU_STATUS_PPR_LOG_OVERFLOW_MASK 0x00000020 + #define IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT 5 ++#define IOMMU_STATUS_PPR_LOG_INT_MASK 0x00000040 + #define IOMMU_STATUS_PPR_LOG_INT_SHIFT 6 ++#define IOMMU_STATUS_PPR_LOG_RUN_MASK 0x00000080 + #define IOMMU_STATUS_PPR_LOG_RUN_SHIFT 7 ++#define IOMMU_STATUS_GAPIC_LOG_OVERFLOW_MASK 0x00000100 ++#define IOMMU_STATUS_GAPIC_LOG_OVERFLOW_SHIFT 8 ++#define IOMMU_STATUS_GAPIC_LOG_INT_MASK 0x00000200 ++#define IOMMU_STATUS_GAPIC_LOG_INT_SHIFT 9 ++#define IOMMU_STATUS_GAPIC_LOG_RUN_MASK 0x00000400 ++#define IOMMU_STATUS_GAPIC_LOG_RUN_SHIFT 10 + + /* I/O Page Table */ + #define IOMMU_PAGE_TABLE_ENTRY_SIZE 8 diff --git a/51d27841-iommu-amd-Workaround-for-erratum-787.patch b/51d27841-iommu-amd-Workaround-for-erratum-787.patch new file mode 100644 index 0000000..ee9ef4a --- /dev/null +++ b/51d27841-iommu-amd-Workaround-for-erratum-787.patch @@ -0,0 +1,57 @@ +# Commit 9eabb0735400e2b6059dfa3f0b47a426f61f570a +# Date 2013-07-02 08:50:41 +0200 +# Author Suravee Suthikulpanit +# Committer Jan Beulich +iommu/amd: Workaround for erratum 787 + +The IOMMU interrupt handling in bottom half must clear the PPR log interrupt +and event log interrupt bits to re-enable the interrupt. This is done by +writing 1 to the memory mapped register to clear the bit. Due to hardware bug, +if the driver tries to clear this bit while the IOMMU hardware also setting +this bit, the conflict will result with the bit being set. If the interrupt +handling code does not make sure to clear this bit, subsequent changes in the +event/PPR logs will no longer generating interrupts, and would result if +buffer overflow. After clearing the bits, the driver must read back +the register to verify. + +Signed-off-by: Suravee Suthikulpanit + +Adjust to apply on top of heavily modified patch 1. Adjust flow to get away +with a single readl() in each instance of the status register checks. + +Signed-off-by: Jan Beulich +Reviewed-by: Tim Deegan +Acked-by: Suravee Suthikulpanit + +--- a/xen/drivers/passthrough/amd/iommu_init.c ++++ b/xen/drivers/passthrough/amd/iommu_init.c +@@ -636,6 +636,14 @@ static void iommu_check_event_log(struct + } + } + ++ /* ++ * Workaround for erratum787: ++ * Re-check to make sure the bit has been cleared. ++ */ ++ entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ if ( entry & IOMMU_STATUS_EVENT_LOG_INT_MASK ) ++ tasklet_schedule(&amd_iommu_irq_tasklet); ++ + spin_unlock_irqrestore(&iommu->lock, flags); + } + +@@ -717,6 +725,14 @@ static void iommu_check_ppr_log(struct a + } + } + ++ /* ++ * Workaround for erratum787: ++ * Re-check to make sure the bit has been cleared. ++ */ ++ entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET); ++ if ( entry & IOMMU_STATUS_PPR_LOG_INT_MASK ) ++ tasklet_schedule(&amd_iommu_irq_tasklet); ++ + spin_unlock_irqrestore(&iommu->lock, flags); + } + diff --git a/51daa074-Revert-hvmloader-always-include-HPET-table.patch b/51daa074-Revert-hvmloader-always-include-HPET-table.patch new file mode 100644 index 0000000..c2cb60f --- /dev/null +++ b/51daa074-Revert-hvmloader-always-include-HPET-table.patch @@ -0,0 +1,37 @@ +References: bnc#817799 + +# Commit 4867685f7916bb594a67f2f64a28bbf5ecb4949c +# Date 2013-07-08 13:20:20 +0200 +# Author Jan Beulich +# Committer Jan Beulich +Revert "hvmloader: always include HPET table" + +This reverts commit e4fd0475a08fda414da27c4e57b568f147cfc07e. + +Conflicts: + tools/firmware/hvmloader/acpi/build.c + +Signed-off-by: Jan Beulich +Acked-by: Keir Fraser + +--- a/tools/firmware/hvmloader/acpi/build.c ++++ b/tools/firmware/hvmloader/acpi/build.c +@@ -268,11 +268,13 @@ static int construct_secondary_tables(un + table_ptrs[nr_tables++] = (unsigned long)madt; + } + +- /* HPET. Always included in DSDT, so always include it here too. */ +- /* (And it's unconditionally required by Windows SVVP tests.) */ +- hpet = construct_hpet(); +- if (!hpet) return -1; +- table_ptrs[nr_tables++] = (unsigned long)hpet; ++ /* HPET. */ ++ if ( hpet_exists(ACPI_HPET_ADDRESS) ) ++ { ++ hpet = construct_hpet(); ++ if (!hpet) return -1; ++ table_ptrs[nr_tables++] = (unsigned long)hpet; ++ } + + /* WAET. */ + waet = construct_waet(); diff --git a/blktapctrl.service b/blktapctrl.service new file mode 100644 index 0000000..e5fdf30 --- /dev/null +++ b/blktapctrl.service @@ -0,0 +1,14 @@ +[Unit] +Description=blktapctrl daemon +RefuseManualStop=true +ConditionPathExists=/proc/xen + +[Service] +Type=forking +Environment=BLKTAPCTRL_ARGS= +EnvironmentFile=-/etc/sysconfig/blktapctrl +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/blktapctrl $BLKTAPCTRL_ARGS + +[Install] +WantedBy=multi-user.target diff --git a/disable_emulated_device.patch b/disable_emulated_device.patch index a93c8bf..486d61f 100644 --- a/disable_emulated_device.patch +++ b/disable_emulated_device.patch @@ -1,8 +1,6 @@ -Index: xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -=================================================================== ---- xen-4.2.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -424,6 +424,11 @@ static int __devinit platform_pci_init(s +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +@@ -419,6 +419,11 @@ static int __devinit platform_pci_init(s platform_mmio = mmio_addr; platform_mmiolen = mmio_len; diff --git a/magic_ioport_compat.patch b/magic_ioport_compat.patch index ff7b80a..d89f355 100644 --- a/magic_ioport_compat.patch +++ b/magic_ioport_compat.patch @@ -2,11 +2,9 @@ Make our PV drivers work with older hosts that do not recognize the new PV driv Signed-off-by: K. Y. Srinivasan -Index: xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -=================================================================== ---- xen-4.2.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -321,7 +321,10 @@ static int check_platform_magic(struct d +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +@@ -316,7 +316,10 @@ static int check_platform_magic(struct d if (magic != XEN_IOPORT_MAGIC_VAL) { err = "unrecognised magic value"; diff --git a/minios-fixups.patch b/minios-fixups.patch deleted file mode 100644 index 71d9788..0000000 --- a/minios-fixups.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: xen-4.3.0-testing/extras/mini-os/lib/math.c -=================================================================== ---- xen-4.3.0-testing.orig/extras/mini-os/lib/math.c -+++ xen-4.3.0-testing/extras/mini-os/lib/math.c -@@ -186,6 +186,7 @@ __qdivrem(u_quad_t uq, u_quad_t vq, u_qu - * and thus - * m = 4 - n <= 2 - */ -+ tmp.ul[H] = tmp.ul[L] = 0; - tmp.uq = uq; - u[0] = 0; - u[1] = HHALF(tmp.ul[H]); diff --git a/pvdrv-import-shared-info.patch b/pvdrv-import-shared-info.patch deleted file mode 100644 index 8c1534b..0000000 --- a/pvdrv-import-shared-info.patch +++ /dev/null @@ -1,62 +0,0 @@ -Index: xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/evtchn.c -=================================================================== ---- xen-4.2.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/evtchn.c -+++ xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/evtchn.c -@@ -40,7 +40,9 @@ - #include - #endif - -+#ifndef shared_info_area - void *shared_info_area; -+#endif - - #define is_valid_evtchn(x) ((x) != 0) - #define evtchn_from_irq(x) (irq_evtchn[irq].evtchn) -Index: xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -=================================================================== ---- xen-4.2.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -@@ -76,7 +76,6 @@ static uint64_t callback_via; - static int __devinit init_xen_info(void) - { - struct xen_add_to_physmap xatp; -- extern void *shared_info_area; - - #ifdef __ia64__ - xencomm_initialize(); -@@ -84,6 +83,7 @@ static int __devinit init_xen_info(void) - - setup_xen_features(); - -+#ifndef shared_info_area - shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT; - xatp.domid = DOMID_SELF; - xatp.idx = 0; -@@ -96,6 +96,11 @@ static int __devinit init_xen_info(void) - ioremap(shared_info_frame << PAGE_SHIFT, PAGE_SIZE); - if (shared_info_area == NULL) - panic("can't map shared info\n"); -+#else -+ shared_info_frame = __pa(shared_info_area) >> PAGE_SHIFT; -+ printk(KERN_INFO "Using kernel provided shared info (pfn=%lx)\n", -+ shared_info_frame); -+#endif - - return 0; - } -Index: xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h -=================================================================== ---- xen-4.2.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h -+++ xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h -@@ -27,6 +27,11 @@ - unsigned long alloc_xen_mmio(unsigned long len); - void platform_pci_resume(void); - -+#ifdef CONFIG_ENLIGHTEN_SPINLOCKS -+#define shared_info_area xen_shared_info -+#endif -+extern void *shared_info_area; -+ - extern struct pci_dev *xen_platform_pdev; - - #endif /* _XEN_PLATFORM_PCI_H */ diff --git a/qemu-xen-dir-remote.tar.bz2 b/qemu-xen-dir-remote.tar.bz2 index 8eb1b9c..5f1aad4 100644 --- a/qemu-xen-dir-remote.tar.bz2 +++ b/qemu-xen-dir-remote.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:15a407d2027fe6c7c058ac9ac3c8bb8fbafbc7369dc770bc660df0c3849713c2 -size 6037625 +oid sha256:866f1faaf1289e513c60a20f93b75fc34302435f39fa337d4ad57cc7958e7640 +size 6037141 diff --git a/qemu-xen-traditional-dir-remote.tar.bz2 b/qemu-xen-traditional-dir-remote.tar.bz2 index 9a3b92a..3ca947a 100644 --- a/qemu-xen-traditional-dir-remote.tar.bz2 +++ b/qemu-xen-traditional-dir-remote.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c283f0fcd7ab3fb9ebfa16f3299e730bf901c4bc52ebe398947acb194e0eedbb -size 3213261 +oid sha256:ac42d369d2b90589531a8d224ac3a65df9cbf58e5625fec98ed5297eb0610d4a +size 3213204 diff --git a/seabios-dir-remote.tar.bz2 b/seabios-dir-remote.tar.bz2 index 259afdb..ac3ebb3 100644 --- a/seabios-dir-remote.tar.bz2 +++ b/seabios-dir-remote.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5f62fcd16fca646e2547f1a829f1b2eb649d74df40f8dc20fbca035d75ec8fcb -size 366614 +oid sha256:455da225a5a4ef25c7f91e7aecec407a012bf5aed4f9d82c8f214f364e9db261 +size 366311 diff --git a/x86-cpufreq-report.patch b/x86-cpufreq-report.patch index 38c0cec..45db59e 100644 --- a/x86-cpufreq-report.patch +++ b/x86-cpufreq-report.patch @@ -1,7 +1,5 @@ -Index: xen-4.3.0-testing/xen/arch/x86/platform_hypercall.c -=================================================================== ---- xen-4.3.0-testing.orig/xen/arch/x86/platform_hypercall.c -+++ xen-4.3.0-testing/xen/arch/x86/platform_hypercall.c +--- a/xen/arch/x86/platform_hypercall.c ++++ b/xen/arch/x86/platform_hypercall.c @@ -25,7 +25,7 @@ #include #include @@ -45,7 +43,7 @@ Index: xen-4.3.0-testing/xen/arch/x86/platform_hypercall.c + op->u.get_cpu_freq.freq = 0; + break; + } -+ if ( copy_field_to_guest(u_xenpf_op, op, u.get_cpu_freq.freq) ) ++ if ( __copy_field_to_guest(u_xenpf_op, op, u.get_cpu_freq.freq) ) + ret = -EFAULT; + } + break; @@ -53,10 +51,8 @@ Index: xen-4.3.0-testing/xen/arch/x86/platform_hypercall.c default: ret = -ENOSYS; break; -Index: xen-4.3.0-testing/xen/include/public/platform.h -=================================================================== ---- xen-4.3.0-testing.orig/xen/include/public/platform.h -+++ xen-4.3.0-testing/xen/include/public/platform.h +--- a/xen/include/public/platform.h ++++ b/xen/include/public/platform.h @@ -527,6 +527,16 @@ struct xenpf_core_parking { typedef struct xenpf_core_parking xenpf_core_parking_t; DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t); diff --git a/xen-4.3.0-testing-src.tar.bz2 b/xen-4.3.0-testing-src.tar.bz2 index e3c5adc..cf7e03c 100644 --- a/xen-4.3.0-testing-src.tar.bz2 +++ b/xen-4.3.0-testing-src.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4638f7326ecbc0d13b6a435179851adbcf6246a034c04b83e571d8f9cc963b6f -size 4356306 +oid sha256:7c25d11d99f7dfbb15987746699f22b213f5b977150ae4bf4c767325430c2d98 +size 4357242 diff --git a/xen-watchdog.service b/xen-watchdog.service new file mode 100644 index 0000000..816a017 --- /dev/null +++ b/xen-watchdog.service @@ -0,0 +1,12 @@ +[Unit] +Description=Xen-watchdog - run xen watchdog daemon +After=xend.service +ConditionPathExists=/proc/xen + +[Service] +Type=forking +ExecStart=/usr/sbin/xenwatchdogd 30 15 +KillSignal=USR1 + +[Install] +WantedBy=multi-user.target diff --git a/xen-xmexample.patch b/xen-xmexample.patch index 22d099a..f757eec 100644 --- a/xen-xmexample.patch +++ b/xen-xmexample.patch @@ -351,12 +351,3 @@ Index: xen-4.3.0-testing/docs/man/xl.pod.1 The basic structure of every B command is almost always: -@@ -910,8 +911,6 @@ The following is the effect of combining - - =item B<-p [pool] -d>... : Illegal - --=item -- - =back - - =item B [I] diff --git a/xen.changes b/xen.changes index e2e320a..76967c6 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,48 @@ +------------------------------------------------------------------- +Wed Jul 31 11:34:14 MDT 2013 - carnold@suse.com + +- Spec file cleanups + xen.spec +- Renamed xend-sysconfig.patch to xencommons-sysconfig.patch + +------------------------------------------------------------------- +Mon Jul 29 16:46:33 MDT 2013 - carnold@suse.com + +- Added support for systemd with the following service files + xenstored.service + blktapctrl.service + xend.service + xenconsoled.service + xen-watchdog.service + xendomains.service + xencommons.service + +------------------------------------------------------------------- +Fri Jul 12 11:05:11 MDT 2013 - carnold@suse.com + +- Upstream patches from Jan + 51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch + 51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch + 51d27841-iommu-amd-Workaround-for-erratum-787.patch + 51daa074-Revert-hvmloader-always-include-HPET-table.patch + +------------------------------------------------------------------- +Fri Jul 12 09:31:01 MDT 2013 - carnold@suse.com + +- Dropped deprecated or unnecessary patches + pvdrv-import-shared-info.patch + minios-fixups.patch + +------------------------------------------------------------------- +Tue Jul 9 13:06:27 MDT 2013 - carnold@suse.com + +- Update to Xen 4.3.0 FCS + +------------------------------------------------------------------- +Fri Jul 5 14:31:51 UTC 2013 - agraf@suse.com + +- Enable ARM targets for Xen + ------------------------------------------------------------------- Thu Jun 27 16:57:08 MDT 2013 - carnold@suse.com diff --git a/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch b/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch index 5c11750..75980f4 100644 --- a/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch +++ b/xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch @@ -9,10 +9,8 @@ Signed-off-by: Olaf Hering unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -Index: xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -=================================================================== ---- xen-4.2.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c -+++ xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c @@ -27,6 +27,7 @@ #include #include @@ -21,7 +19,7 @@ Index: xen-4.2.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci. #include #include #include -@@ -477,6 +478,18 @@ static struct pci_device_id platform_pci +@@ -472,6 +473,18 @@ static struct pci_device_id platform_pci MODULE_DEVICE_TABLE(pci, platform_pci_tbl); diff --git a/xen.spec b/xen.spec index f59c73b..5fe63af 100644 --- a/xen.spec +++ b/xen.spec @@ -15,15 +15,19 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - Name: xen -ExclusiveArch: %ix86 x86_64 +ExclusiveArch: %ix86 x86_64 %arm aarch64 %define xvers 4.3 %define xvermaj 4 -%define changeset 27190 +%define changeset 27204 %define xen_build_dir xen-4.3.0-testing +%ifarch %arm aarch64 +%define with_kmp 0 +%define with_stubdom 0 +%else %define with_kmp 1 %define with_stubdom 1 +%endif # EFI requires gcc46 or newer # its available in 12.1 or >= sles11sp2 %if %suse_version == 1210 || %suse_version == 1110 @@ -31,27 +35,34 @@ ExclusiveArch: %ix86 x86_64 %else %define with_gcc46 0 %endif -%ifarch x86_64 +%ifarch x86_64 %arm aarch64 %define with_dom0_support 1 %else %define with_dom0_support 0 %endif %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services %if %suse_version >= 1230 +%define with_systemd 1 %define with_xend 0 %else %define with_xend 1 +%define with_systemd 0 %endif BuildRequires: LibVNCServer-devel BuildRequires: SDL-devel BuildRequires: automake +%ifnarch %arm aarch64 BuildRequires: bin86 +%endif BuildRequires: curl-devel +%ifnarch %arm aarch64 BuildRequires: dev86 +%endif BuildRequires: fdupes BuildRequires: glib2-devel BuildRequires: graphviz BuildRequires: latex2html +BuildRequires: libaio-devel BuildRequires: libbz2-devel BuildRequires: libjpeg-devel BuildRequires: libpixman-1-0-devel @@ -65,14 +76,19 @@ BuildRequires: pciutils-devel BuildRequires: python-devel BuildRequires: texinfo BuildRequires: transfig +%if %suse_version >= 1230 +BuildRequires: systemd +%endif %if %suse_version >= 1120 BuildRequires: xz-devel %endif %if %suse_version <= 1110 BuildRequires: pmtools %else +%ifnarch %arm aarch64 BuildRequires: acpica %endif +%endif %if %suse_version >= 1030 BuildRequires: texlive BuildRequires: texlive-latex @@ -107,8 +123,10 @@ BuildRequires: glibc-devel-32bit %define pae_enabled n %else %define max_cpus 32 +%ifnarch %arm %define pae_enabled y %endif +%endif BuildRequires: glibc-devel %if %{?with_kmp}0 BuildRequires: kernel-source @@ -120,7 +138,7 @@ BuildRequires: xorg-x11 BuildRequires: lndir %endif %endif -Version: 4.3.0_06 +Version: 4.3.0_08 Release: 0 PreReq: %insserv_prereq %fillup_prereq Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) @@ -158,18 +176,30 @@ Source29: block-dmmd # Xen API remote authentication sources Source30: etc_pam.d_xen-api Source31: xenapiusers -# sysconfig hook script for Xen +# Sysconfig hook script for Xen Source32: xen-updown.sh # Firewall service file for xend relocation server Source33: xend-relocation-server.fw -# init script and sysconf file for pciback +# Init script and sysconf file for pciback Source34: init.pciback Source35: sysconfig.pciback Source36: xnloader.py +# Systemd service files +Source40: xenstored.service +Source41: blktapctrl.service +Source42: xend.service +Source43: xenconsoled.service +Source44: xen-watchdog.service +Source45: xendomains.service +Source46: xencommons.service Source99: baselibs.conf # http://xenbits.xensource.com/ext/xenalyze Source20000: xenalyze.hg.tar.bz2 # Upstream patches +Patch1: 51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch +Patch2: 51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch +Patch3: 51d27841-iommu-amd-Workaround-for-erratum-787.patch +Patch4: 51daa074-Revert-hvmloader-always-include-HPET-table.patch # Upstream qemu patches # Our patches Patch301: xen-destdir.patch @@ -187,15 +217,14 @@ Patch321: udev-rules.patch Patch322: libxen_permissive.patch Patch323: xenconsole-no-multiple-connections.patch # Needs to go upstream -Patch330: xend-sysconfig.patch +Patch330: xencommons-sysconfig.patch Patch331: suspend_evtchn_lock.patch Patch332: xenpaging.doc.patch # Other bug fixes or features Patch350: hibernate.patch Patch351: stdvga-cache.patch -Patch352: minios-fixups.patch -Patch353: ipxe-enable-nics.patch -Patch354: pygrub-netware-xnloader.patch +Patch352: ipxe-enable-nics.patch +Patch353: pygrub-netware-xnloader.patch Patch360: blktapctrl-close-fifos.patch Patch361: blktapctrl-default-to-ioemu.patch Patch362: blktapctrl-disable-debug-printf.patch @@ -206,10 +235,9 @@ Patch502: x86-cpufreq-report.patch Patch503: x86-dom-print.patch Patch504: x86-extra-trap-info.patch Patch520: supported_module.patch -Patch521: pvdrv-import-shared-info.patch -Patch522: magic_ioport_compat.patch -Patch523: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch -Patch524: disable_emulated_device.patch +Patch521: magic_ioport_compat.patch +Patch522: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch +Patch523: disable_emulated_device.patch # Legacy Xend and Qemu patches Patch800: xend-traditional-qemu.patch # Build patches @@ -254,15 +282,10 @@ Xen starts up. Other domains have no access to the hardware; instead they use virtual interfaces that are provided by Xen (with the help of the domain 0 kernel). -Xen does support booting other Operating Systems; ports of NetBSD -(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) -exist. A port of Windows XP was developed for an earlier version of -Xen, but is not available for release due to license restrictions. - -In addition to this package you need to install the kernel-xen and -xen-tools to use Xen. Xen 3 also supports running unmodified guests -using full virtualization, if appropriate hardware is present. Install -xen-tools-ioemu if you want to use this. +In addition to this package you need to install the kernel-xen, xen-libs +and xen-tools packages to use Xen. Xen version 3 and newer also supports +running unmodified guests using full virtualization, if appropriate hardware +is present. [Hypervisor is a trademark of IBM] @@ -289,34 +312,8 @@ performance and resource isolation. This package contains the libraries used to interact with the Xen virtual machine monitor. -Modern computers are sufficiently powerful to use virtualization to -present the illusion of many smaller virtual machines (VMs), each -running a separate operating system instance. Successful partitioning -of a machine to support the concurrent execution of multiple operating -systems poses several challenges. Firstly, virtual machines must be -isolated from one another: It is not acceptable for the execution of -one to adversely affect the performance of another. This is -particularly true when virtual machines are owned by mutually -untrusting users. Secondly, it is necessary to support a variety of -different operating systems to accommodate the heterogeneity of popular -applications. Thirdly, the performance overhead introduced by -virtualization should be small. - -Xen uses a technique called paravirtualization: The guest OS is -modified, mainly to enhance performance. - -The Xen hypervisor (microkernel) does not provide device drivers for -your hardware (except for CPU and memory). This job is left to the -kernel that's running in domain 0. Thus the domain 0 kernel is -privileged; it has full hardware access. It's started immediately after -Xen starts up. Other domains have no access to the hardware; instead -they use virtual interfaces that are provided by Xen (with the help of -the domain 0 kernel). - -Xen does support booting other Operating Systems; ports of NetBSD -(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) -exist. A port of Windows XP was developed for an earlier version of -Xen, but is not available for release due to license restrictions. +In addition to this package you need to install kernel-xen, xen and +xen-tools to use Xen. @@ -351,37 +348,9 @@ performance and resource isolation. This package contains the control tools that allow you to start, stop, migrate, and manage virtual machines. -Modern computers are sufficiently powerful to use virtualization to -present the illusion of many smaller virtual machines (VMs), each -running a separate operating system instance. Successful partitioning -of a machine to support the concurrent execution of multiple operating -systems poses several challenges. Firstly, virtual machines must be -isolated from one another: It is not acceptable for the execution of -one to adversely affect the performance of another. This is -particularly true when virtual machines are owned by mutually -untrusting users. Secondly, it is necessary to support a variety of -different operating systems to accommodate the heterogeneity of popular -applications. Thirdly, the performance overhead introduced by -virtualization should be small. +In addition to this package you need to install kernel-xen, xen and +xen-libs to use Xen. -Xen uses a technique called paravirtualization: The guest OS is -modified, mainly to enhance performance. - -The Xen hypervisor (microkernel) does not provide device drivers for -your hardware (except for CPU and memory). This job is left to the -kernel that's running in domain 0. Thus the domain 0 kernel is -privileged; it has full hardware access. It's started immediately after -Xen starts up. Other domains have no access to the hardware; instead -they use virtual interfaces that are provided by Xen (with the help of -the domain 0 kernel). - -Xen does support booting other Operating Systems; ports of NetBSD -(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) -exist. A port of Windows XP was developed for an earlier version of -Xen, but is not available for release due to license restrictions. - -In addition to this package you need to install kernel-xen and xen to -use Xen. Authors: @@ -406,12 +375,12 @@ Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. -This sub-package contains the control tools that allow you to start, -stop, migrate, and manage virtual machines using the legacy xend -toolstack. +This package contains the control tools that allow you to start, stop +migrate, and manage virtual machines using the legacy xend/xm toolstack. + +In addition to this package you need to install kernel-xen, xen and +xen-libs to use Xen. -In addition to this package you need to install kernel-xen and xen to -use Xen. Authors: @@ -451,35 +420,6 @@ performance and resource isolation. This package contains the libraries and header files needed to create tools to control virtual machines. -Modern computers are sufficiently powerful to use virtualization to -present the illusion of many smaller virtual machines (VMs), each -running a separate operating system instance. Successful partitioning -of a machine to support the concurrent execution of multiple operating -systems poses several challenges. Firstly, virtual machines must be -isolated from one another: It is not acceptable for the execution of -one to adversely affect the performance of another. This is -particularly true when virtual machines are owned by mutually -untrusting users. Secondly, it is necessary to support a variety of -different operating systems to accommodate the heterogeneity of popular -applications. Thirdly, the performance overhead introduced by -virtualization should be small. - -Xen uses a technique called paravirtualization: The guest OS is -modified, mainly to enhance performance. - -The Xen hypervisor (microkernel) does not provide device drivers for -your hardware (except for CPU and memory). This job is left to the -kernel that's running in domain 0. Thus the domain 0 kernel is -privileged; it has full hardware access. It's started immediately after -Xen starts up. Other domains have no access to the hardware; instead -they use virtual interfaces that are provided by Xen (with the help of -the domain 0 kernel). - -Xen does support booting other Operating Systems; ports of NetBSD -(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) -exist. A port of Windows XP was developed for an earlier version of -Xen, but is not available for release due to license restrictions. - Authors: @@ -494,45 +434,12 @@ Group: System/Kernel Conflicts: xen %description KMP -Xen para-virtual device drivers for fully virtualized guests - Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. -This package contains the libraries and header files needed to create -tools to control virtual machines. - -Modern computers are sufficiently powerful to use virtualization to -present the illusion of many smaller virtual machines (VMs), each -running a separate operating system instance. Successful partitioning -of a machine to support the concurrent execution of multiple operating -systems poses several challenges. Firstly, virtual machines must be -isolated from one another: It is not acceptable for the execution of -one to adversely affect the performance of another. This is -particularly true when virtual machines are owned by mutually -untrusting users. Secondly, it is necessary to support a variety of -different operating systems to accommodate the heterogeneity of popular -applications. Thirdly, the performance overhead introduced by -virtualization should be small. - -Xen uses a technique called paravirtualization: The guest OS is -modified, mainly to enhance performance. - -The Xen hypervisor (microkernel) does not provide device drivers for -your hardware (except for CPU and memory). This job is left to the -kernel that's running in domain 0. Thus the domain 0 kernel is -privileged; it has full hardware access. It's started immediately after -Xen starts up. Other domains have no access to the hardware; instead -they use virtual interfaces that are provided by Xen (with the help of -the domain 0 kernel). - -Xen does support booting other Operating Systems; ports of NetBSD -(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) -exist. A port of Windows XP was developed for an earlier version of -Xen, but is not available for release due to license restrictions. - - +This package contains the Xen para-virtual device drivers for fully +virtualized guests. %endif @@ -581,6 +488,10 @@ Authors # Upstream patches # Qemu # Our patches +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %patch301 -p1 %patch302 -p1 %patch303 -p1 @@ -602,7 +513,6 @@ Authors %patch351 -p1 %patch352 -p1 %patch353 -p1 -%patch354 -p1 %patch360 -p1 %patch361 -p1 %patch362 -p1 @@ -615,7 +525,6 @@ Authors %patch521 -p1 %patch522 -p1 %patch523 -p1 -%patch524 -p1 %patch800 -p1 %patch99997 -p1 %patch99998 -p1 @@ -644,7 +553,9 @@ export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS" --datadir=%{_datadir} %if %{?with_dom0_support}0 CFLAGS_SAVE=$CFLAGS +%ifnarch %arm aarch64 make -C xenalyze.hg CC="gcc -I../xen/include -DMAX_CPUS=%{max_cpus} ${RPM_OPT_FLAGS}" %{?_smp_mflags} -k +%endif make -C tools/include/xen-foreign %{?_smp_mflags} make tools docs %{?_smp_mflags} make -C tools/debugger/gdbsx @@ -654,7 +565,7 @@ make -C tools/include/xen-foreign %{?_smp_mflags} make tools docs %{?_smp_mflags} %endif %if %{?with_kmp}0 -# pv driver modules +# PV driver modules export XL=/usr/src/linux export XEN=/usr/src/linux/include/xen mkdir -p obj @@ -676,7 +587,7 @@ export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS" %if %{?with_dom0_support}0 # EFI -%ifarch x86_64 +%ifarch x86_64 %arm aarch64 make -C xen install \ %if %{?with_gcc46}0 CC=gcc-4.6 \ @@ -703,9 +614,11 @@ install_xen() ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}.gz ln -sf xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext} } +%ifnarch %arm aarch64 make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags} install_xen dbg make -C xen clean +%endif make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags} install_xen make -C xen clean @@ -715,21 +628,23 @@ export XEN_PYTHON_NATIVE_INSTALL=1 make -C tools install \ DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags} rm -f $RPM_BUILD_ROOT/usr/sbin/{qcow-create,img2qcow,qcow2raw} +echo > xen.files.txt %ifarch x86_64 mkdir -p $RPM_BUILD_ROOT/${_libdir}/xen/bin/ ln -s /usr/lib/xen/bin/qemu-dm $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm -%endif -# efi depends on gcc46 -echo > xen.files.txt + +# EFI depends on gcc46 if test -d $RPM_BUILD_ROOT%{_libdir}/efi then echo %{_libdir}/efi >> xen.files.txt fi cp -avL xenalyze.hg/dump-raw $RPM_BUILD_ROOT/%{_bindir}/xenalyze.dump-raw cp -avL xenalyze.hg/xenalyze $RPM_BUILD_ROOT/%{_bindir} +%endif %else make -C tools install DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags} %endif + # PV driver modules %if %{?with_kmp}0 export INSTALL_MOD_PATH=$RPM_BUILD_ROOT @@ -742,9 +657,10 @@ for flavor in %flavors_to_build; do done %endif %if %{?with_dom0_support}0 + # Stubdom %if %{?with_stubdom}0 -#remove -fstack-protector flag for stubdom build section +# remove -fstack-protector flag for stubdom build section export EXTRA_CFLAGS_XEN_TOOLS=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g') export EXTRA_CFLAGS_QEMU_TRADITIONAL=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g') export EXTRA_CFLAGS_QEMU_XEN=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g') @@ -757,11 +673,12 @@ mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen ln -s /usr/lib/xen/bin/stubdom-dm $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdom-dm ln -s /usr/lib/xen/bin/stubdompath.sh $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdompath.sh %endif -#restore -fstack-protector flag +# restore -fstack-protector flag export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS" %endif + # Docs make -C docs install \ DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \ @@ -774,43 +691,54 @@ for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt xenpaging.txt; do install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/ done %endif -# init scripts + +# Init scripts %if %{?with_dom0_support}0 mkdir -p $RPM_BUILD_ROOT/etc/init.d +%ifnarch %arm aarch64 install %SOURCE13 $RPM_BUILD_ROOT/etc/init.d/xend ln -s /etc/init.d/xend $RPM_BUILD_ROOT/usr/sbin/rcxend -install %SOURCE14 $RPM_BUILD_ROOT/etc/init.d/xendomains +%endif +install tools/hotplug/Linux/init.d/xendomains $RPM_BUILD_ROOT/etc/init.d/xendomains ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains +%ifnarch %arm aarch64 install %SOURCE34 $RPM_BUILD_ROOT/etc/init.d/pciback ln -s /etc/init.d/pciback $RPM_BUILD_ROOT/usr/sbin/rcpciback install %SOURCE35 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pciback +%endif mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d install -m644 %SOURCE26 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop.conf -# example config + +# Example config mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples,scripts} mv $RPM_BUILD_ROOT/etc/xen/xmexample* $RPM_BUILD_ROOT/etc/xen/examples mv $RPM_BUILD_ROOT/etc/xen/xlexample* $RPM_BUILD_ROOT/etc/xen/examples rm -f $RPM_BUILD_ROOT/etc/xen/examples/*nbd install -m644 %SOURCE17 %SOURCE18 $RPM_BUILD_ROOT/etc/xen/examples/ install -m644 tools/xentrace/formats $RPM_BUILD_ROOT/etc/xen/examples/xentrace_formats.txt -# scripts + +# Scripts rm -f $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd install -m755 %SOURCE19 %SOURCE20 %SOURCE21 %SOURCE22 %SOURCE23 %SOURCE24 %SOURCE25 %SOURCE29 $RPM_BUILD_ROOT/etc/xen/scripts/ ln -s /etc/xen/scripts/vm-monitor $RPM_BUILD_ROOT/etc/xen/scripts/set-lock + # Xen API remote authentication files install -d $RPM_BUILD_ROOT/etc/pam.d install -m644 %SOURCE30 $RPM_BUILD_ROOT/etc/pam.d/xen-api install -m644 %SOURCE31 $RPM_BUILD_ROOT/etc/xen/ -# sysconfig hook for Xen + +# Sysconfig hook for Xen mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/scripts mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d install -m755 %SOURCE32 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/xen ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d/xen -# logrotate + +# Logrotate install -m644 -D %SOURCE15 $RPM_BUILD_ROOT/etc/logrotate.d/xen -# directories + +# Directories mkdir -p $RPM_BUILD_ROOT/var/lib/xenstored mkdir -p $RPM_BUILD_ROOT/var/lib/xen/images mkdir -p $RPM_BUILD_ROOT/var/lib/xen/jobs @@ -822,60 +750,55 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet mkdir -p $RPM_BUILD_ROOT/var/log/xen mkdir -p $RPM_BUILD_ROOT/var/log/xen/console ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images + # Bootloader +mkdir -p $RPM_BUILD_ROOT/usr/lib/xen/boot/ install -m755 %SOURCE16 $RPM_BUILD_ROOT/usr/lib/xen/boot/ install -m755 %SOURCE36 $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages -# udev support + +# Udev support mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules mv $RPM_BUILD_ROOT/etc/udev/rules.d/xend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xend.rules -# xen utils + +# Systemd +%if %{?with_systemd}0 +mkdir -p %{buildroot}%{_unitdir} +install -m 644 %{SOURCE40} %{buildroot}%{_unitdir}/xenstored.service +install -m 644 %{SOURCE41} %{buildroot}%{_unitdir}/blktapctrl.service +install -m 644 %{SOURCE42} %{buildroot}%{_unitdir}/xend.service +install -m 644 %{SOURCE43} %{buildroot}%{_unitdir}/xenconsoled.service +install -m 644 %{SOURCE44} %{buildroot}%{_unitdir}/xen-watchdog.service +install -m 644 %{SOURCE45} %{buildroot}%{_unitdir}/xendomains.service +install -m 644 %{SOURCE46} %{buildroot}%{_unitdir}/xencommons.service +%endif + +# Xen utils make -C tools/xen-utils-0.1 install DESTDIR=$RPM_BUILD_ROOT XEN_INTREE_BUILD=yes XEN_ROOT=$PWD + # Clean up unpackaged files -rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/xen/qemu/ -rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/qemu/qemu-* rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/packages/xen/html/hypercall/.deps -rm -rf $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ps -rm -rf $RPM_BUILD_ROOT/usr/share/xen/man/man1/qemu* -rm -rf $RPM_BUILD_ROOT/usr/share/xen/man/man8/qemu* -rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-ppc -rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-ppc -rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-ppc -rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc32 -rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-sparc32 -rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-sparc32 -rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc64 -rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-sparc64 -rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-sparc64 -rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/palcode-clipper +rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-* +rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-* rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/palcode-clipper -rm -f $RPM_BUILD_ROOT/usr/sbin/netfix rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info -rm -rf $RPM_BUILD_ROOT/html rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.* -rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-img-xen rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-nbd-xen -rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug rm -rf $RPM_BUILD_ROOT/usr/lib/debug -# Upstream Qemu -rm -rf $RPM_BUILD_ROOT/usr/local/share/qemu -rm -rf $RPM_BUILD_ROOT/usr/local/share/doc/qemu rm -f $RPM_BUILD_ROOT/usr/local/etc/qemu/target-x86_64.conf -rm -f $RPM_BUILD_ROOT/usr/local/share/man/man1/qemu.1 -rm -f $RPM_BUILD_ROOT/usr/local/share/man/man1/qemu-img.1 -rm -f $RPM_BUILD_ROOT/usr/local/share/man/man8/qemu-nbd.8 -rm -f $RPM_BUILD_ROOT/usr/local/share/doc/qemu/qemu-doc.html -rm -f $RPM_BUILD_ROOT/usr/local/share/doc/qemu/qemu-tech.html rm -f $RPM_BUILD_ROOT/usr/etc/qemu/target-x86_64.conf rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper -#install firewall definitions format is described here: -#/usr/share/SuSEfirewall2/services/TEMPLATE + +# Install firewall definitions format is described here: +# /usr/share/SuSEfirewall2/services/TEMPLATE mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir} install -m 644 %{S:26} $RPM_BUILD_ROOT/%{_fwdefdir}/xend-relocation-server # create symlinks for keymaps %fdupes -s $RPM_BUILD_ROOT/%{_datadir} + %else + # 32 bit hypervisor no longer supported. Remove dom0 tools. rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc rm -rf $RPM_BUILD_ROOT/usr/local/share/doc @@ -918,14 +841,18 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper /boot/xen-%{version}-%{release}.gz /boot/xen-%{xvermaj}.gz /boot/xen-%{xvers}.gz +%ifnarch %arm aarch64 /boot/xen-dbg-%{version}-%{release}.gz /boot/xen-dbg-%{xvermaj}.gz /boot/xen-dbg-%{xvers}.gz /boot/xen-dbg.gz +%endif /boot/xen-syms /boot/xen-syms-%{version}-%{release} +%ifnarch %arm aarch64 /boot/xen-syms-dbg /boot/xen-syms-dbg-%{version}-%{release} +%endif /boot/xen.gz %endif @@ -938,23 +865,31 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %files tools %defattr(-,root,root) +%ifnarch %arm aarch64 /usr/bin/xenalyze /usr/bin/xenalyze.dump-raw +%endif /usr/bin/xencons /usr/bin/xenstore* /usr/bin/xentrace* /usr/bin/pygrub +%ifnarch %arm aarch64 /usr/bin/tapdisk-ioemu /usr/bin/remus /usr/bin/xencov_split /usr/sbin/blktapctrl +%endif /usr/sbin/flask-* /usr/sbin/tap* +/usr/sbin/rcxendomains +%ifnarch %arm aarch64 /usr/sbin/rcpciback /usr/sbin/xenbaked +%endif /usr/sbin/xenconsoled /usr/sbin/xencov /usr/sbin/xen-destroy +%ifnarch %arm aarch64 /usr/sbin/xen-hptool /usr/sbin/xen-hvmcrash /usr/sbin/xen-hvmctx @@ -965,23 +900,32 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper /usr/sbin/xenperf /usr/sbin/xenpm /usr/sbin/xenpmd +%endif /usr/sbin/xen-ringwatch /usr/sbin/xenstored +%ifnarch %arm aarch64 /usr/sbin/xen-tmem-list-parse +%endif /usr/sbin/xentop +%ifnarch %arm aarch64 /usr/sbin/xentrace_setmask /usr/sbin/xen-vmresync +%endif /usr/sbin/xenwatchdogd /usr/sbin/xsview /usr/sbin/gtracestat /usr/sbin/gtraceview /usr/sbin/lock-util /usr/sbin/td-util +%ifnarch %arm aarch64 /usr/sbin/vhd-update /usr/sbin/vhd-util /usr/sbin/gdbsx +%endif /usr/sbin/xl +%ifnarch %arm aarch64 /usr/sbin/kdd +%endif %dir %attr(700,root,root) /etc/xen %dir /etc/xen/scripts /etc/xen/scripts/blktap @@ -992,7 +936,9 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper /etc/xen/scripts/locking.sh /etc/xen/scripts/logging.sh /etc/xen/scripts/network-* +%ifnarch %arm aarch64 /etc/xen/scripts/qemu-ifup +%endif /etc/xen/scripts/set-lock /etc/xen/scripts/vif2 /etc/xen/scripts/vif-* @@ -1003,17 +949,21 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper /etc/xen/scripts/xen-script-common.sh /etc/xen/scripts/xmclone.sh %{_libdir}/xen -%ifarch x86_64 +%ifarch x86_64 aarch64 /usr/lib/xen %endif -%dir /var/adm/fillup-templates +%ifnarch %arm aarch64 /var/adm/fillup-templates/sysconfig.pciback +%endif /var/adm/fillup-templates/sysconfig.xencommons +/var/adm/fillup-templates/sysconfig.xendomains %dir /var/lib/xen %dir %attr(700,root,root) /var/lib/xen/images %dir %attr(700,root,root) /var/lib/xen/save %dir %attr(700,root,root) /var/lib/xen/dump +%ifnarch %arm aarch64 %dir %attr(700,root,root) /var/lib/xen/xenpaging +%endif %dir /var/lib/xenstored %dir /var/log/xen %dir /var/log/xen/console @@ -1028,10 +978,20 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %config(noreplace) /etc/xen/xl.conf %config /etc/pam.d/xen-api %config /etc/modprobe.d/xen_loop.conf -%dir /etc/init.d %config /etc/init.d/xencommons +%config /etc/init.d/xendomains %config /etc/init.d/xen-watchdog +%ifnarch %arm aarch64 %config /etc/init.d/pciback +%endif +%if %{?with_systemd}0 +%{_unitdir}/xendomains.service +%{_unitdir}/xencommons.service +%{_unitdir}/xenstored.service +%{_unitdir}/blktapctrl.service +%{_unitdir}/xenconsoled.service +%{_unitdir}/xen-watchdog.service +%endif %dir /etc/modprobe.d %dir /etc/udev %dir /etc/udev/rules.d @@ -1040,12 +1000,16 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper /etc/sysconfig/network/if-up.d/xen /etc/sysconfig/network/if-down.d/xen /etc/bash_completion.d/xl.sh +%ifnarch %arm aarch64 %dir %{_datadir}/qemu-xen %{_datadir}/qemu-xen/* +%endif %dir %{_datadir}/xen %{_datadir}/xen/*.dtd +%ifnarch %arm aarch64 %dir %{_datadir}/xen/qemu %{_datadir}/xen/qemu/* +%endif %dir %{_libdir}/python%{pyver}/site-packages/grub %dir %{_libdir}/python%{pyver}/site-packages/xen %dir %{_libdir}/python%{pyver}/site-packages/xen/lowlevel @@ -1062,9 +1026,6 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %{_defaultdocdir}/xen/boot.local.xenU %{_defaultdocdir}/xen/boot.xen %{_defaultdocdir}/xen/misc -%dir %{_mandir}/man1 -%dir %{_mandir}/man5 -%dir %{_mandir}/man8 %{_mandir}/man1/xen-list.1.gz %{_mandir}/man1/xentop.1.gz %{_mandir}/man1/xentrace_format.1.gz @@ -1076,8 +1037,10 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %files xend-tools %defattr(-,root,root) +%ifnarch %arm aarch64 /etc/udev/rules.d/40-xend.rules -/usr/sbin/rcxendomains +%endif +%ifnarch %arm aarch64 /usr/sbin/rcxend /usr/sbin/xm /usr/sbin/xend @@ -1093,13 +1056,15 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %dir %{_libdir}/python%{pyver}/site-packages/xen/xend %dir %{_libdir}/python%{pyver}/site-packages/xen/xm %dir %{_libdir}/python%{pyver}/site-packages/xen/web -/var/adm/fillup-templates/sysconfig.xendomains -%dir /etc/init.d %config /etc/init.d/xend -%config /etc/init.d/xendomains +%if %{?with_systemd}0 +%{_unitdir}/xend.service +%endif +%endif %dir %attr(700,root,root) /etc/xen %config(noreplace) /etc/xen/*.sxp %config(noreplace) /etc/xen/*.xml +%ifnarch %arm aarch64 /etc/xen/scripts/xend-relocation.sh %{_libdir}/python%{pyver}/site-packages/xen/remus/* %{_libdir}/python%{pyver}/site-packages/xen/sv/* @@ -1108,16 +1073,17 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %{_libdir}/python%{pyver}/site-packages/xen/xm/* %{_libdir}/python%{pyver}/site-packages/xen/web/* %config %{_fwdefdir}/xend-relocation-server -%dir %{_mandir}/man1 -%dir %{_mandir}/man5 %{_mandir}/man1/xm.1.gz %{_mandir}/man5/xmdomain.cfg.5.gz %{_mandir}/man5/xend-config.sxp.5.gz %endif +%endif %files tools-domU %defattr(-,root,root) +%ifnarch %arm aarch64 /usr/bin/xen-detect +%endif /bin/domu-xenstore /bin/xenstore-* @@ -1132,15 +1098,19 @@ rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %files doc-html %defattr(-,root,root) %{_defaultdocdir}/xen/html -#%{_datadir}/doc/qemu %endif %if %{?with_dom0_support}0 %post tools %if %{?with_xend}0 -# with_xend -# enable both xm (xend based) and xl (libxl based) +%if %{?with_systemd}0 +%{fillup_and_insserv -i -y -n xencommons xencommons} +%{fillup_and_insserv -i -y -n xend xend} +/bin/systemctl enable xend.service +/bin/systemctl enable xencommons.service +%else +# Enable both xm (xend based) and xl (libxl based) if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled." @@ -1151,9 +1121,14 @@ else %{fillup_and_insserv -y -n xencommons xencommons} fi %{fillup_and_insserv -y -n xend xend} +%endif %else # without_xend -# disable xm (xend based) and enable only xl (libxl based) +%if %{?with_systemd}0 +%{fillup_and_insserv -i -y -n xencommons xencommons} +/bin/systemctl enable xencommons.service +%else +# Disable xm (xend based) and enable only xl (libxl based) if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled." @@ -1166,7 +1141,13 @@ else %{fillup_and_insserv -y -n xencommons xencommons} fi %endif +%endif # +%ifnarch %arm aarch64 +%if %{?with_systemd}0 +%{fillup_and_insserv -i -y -n xendomains xendomains} +/bin/systemctl enable xendomains.service +%else %{fillup_and_insserv -y -n xendomains xendomains} %{fillup_only -n pciback} if [ -f /usr/bin/qemu-img ]; then @@ -1181,9 +1162,17 @@ if [ -f /usr/bin/qemu-nbd ]; then fi ln -s /usr/bin/qemu-nbd /usr/bin/qemu-nbd-xen fi +%endif +%endif %preun tools +%if %{?with_systemd}0 +/bin/systemctl disable xend.service +/bin/systemctl disable xencommons.service +/bin/systemctl disable xendomains.service +%else %{stop_on_removal xendomains xend xencommons} +%endif %postun tools %if %{?with_xend}0 @@ -1191,6 +1180,7 @@ fi %{restart_on_update xend} %endif %{insserv_cleanup} +%ifnarch %arm aarch64 if [ -f /usr/bin/qemu-img-xen ]; then rm /usr/bin/qemu-img-xen fi @@ -1198,6 +1188,7 @@ if [ -f /usr/bin/qemu-nbd-xen ]; then rm /usr/bin/qemu-nbd-xen fi %endif +%endif %post libs -p /sbin/ldconfig diff --git a/xend-sysconfig.patch b/xencommons-sysconfig.patch similarity index 100% rename from xend-sysconfig.patch rename to xencommons-sysconfig.patch diff --git a/xencommons.service b/xencommons.service new file mode 100644 index 0000000..98574a1 --- /dev/null +++ b/xencommons.service @@ -0,0 +1,13 @@ +[Unit] +Description=Xencommons - Script to start and stop xenstored and xenconsoled +ConditionPathExists=/proc/xen + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=-/etc/init.d/xencommons start +ExecStop=/etc/init.d/xencommons stop + +[Install] +WantedBy=multi-user.target diff --git a/xenconsoled.service b/xenconsoled.service new file mode 100644 index 0000000..e4dc9a4 --- /dev/null +++ b/xenconsoled.service @@ -0,0 +1,17 @@ +[Unit] +Description=Xenconsoled - handles logging from guest consoles and hypervisor +After=xenstored.service +ConditionPathExists=/proc/xen + +[Service] +Type=simple +Environment=XENCONSOLED_ARGS= +Environment=XENCONSOLED_LOG=none +Environment=XENCONSOLED_LOG_DIR=/var/log/xen/console +EnvironmentFile=-/etc/sysconfig/xenconsoled +PIDFile=/var/run/xenconsoled.pid +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/xenconsoled --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS + +[Install] +WantedBy=multi-user.target diff --git a/xend.service b/xend.service new file mode 100644 index 0000000..6ef546d --- /dev/null +++ b/xend.service @@ -0,0 +1,14 @@ +[Unit] +Description=Xend - Starts and stops the Xen management daemon +Before=libvirtd.service libvirt-guests.service +ConditionPathExists=/proc/xen + +[Service] +Type=forking +PIDFile=/var/run/xend.pid +Environment=HOME=/root +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/xend + +[Install] +WantedBy=multi-user.target diff --git a/xendomains.service b/xendomains.service new file mode 100644 index 0000000..96adcbe --- /dev/null +++ b/xendomains.service @@ -0,0 +1,15 @@ +[Unit] +Description=Xendomains - start and stop Xen VMs on boot and shutdown +Requires=xenstored.service xenconsoled.service +After=xenstored.service xenconsoled.service +ConditionPathExists=/proc/xen + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=-/etc/init.d/xendomains start +ExecStop=/etc/init.d/xendomains stop + +[Install] +WantedBy=multi-user.target diff --git a/xenstored.service b/xenstored.service new file mode 100644 index 0000000..9d0ea83 --- /dev/null +++ b/xenstored.service @@ -0,0 +1,16 @@ +[Unit] +Description=Xenstored - daemon managing xenstore file system +Before=libvirtd.service libvirt-guests.service +RefuseManualStop=true +ConditionPathExists=/proc/xen + +[Service] +Type=forking +Environment=XENSTORED_ARGS= +EnvironmentFile=-/etc/sysconfig/xenstored +PIDFile=/var/run/xenstored.pid +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS + +[Install] +WantedBy=multi-user.target