From elisabetheladia@gaynellmartin.com Mon Aug 01 08:31:34 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 01 Aug 2011 08:31:34 -0700 Received: from net-188-216-86-240.cust.dsl.vodafone.it ([188.216.86.240] helo=z93gf14wazce) by lists.xensource.com with smtp (Exim 4.43) id 1QnuSr-0000Yp-Ch; Mon, 01 Aug 2011 08:31:34 -0700 Date: Mon, 01 Aug 2011 19:28:20 +0300 From: "Mellisa Miss" To: MIME-Version: 1.0 Message-ID: <96s31y23m81-31566560-204b2x85@xumwhspph> Subject: Best Replica Watches at $130 each Content-Type: multipart/alternative; boundary="----=_NextPart_007_07D8_8258C130.0BBBF44E" ------=_NextPart_007_07D8_8258C130.0BBBF44E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Best Replica Watches at $130 each When you purchase Replica Watches, Fake Watch, you are automatically assured of the best in quality as well as our utmost commitment to service excellence. Fake Watches Free Shipping - Buy Now! http://famouswatchescolor.ru ------=_NextPart_007_07D8_8258C130.0BBBF44E Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Best Replica Watches at $130 each

When you purchase Replica Watches, Fake Watch, you are automatically assured of the best in quality as well as our utmost commitment to service excellence.

Fake Watches Free Shipping - Buy Now!
------=_NextPart_007_07D8_8258C130.0BBBF44E-- From martivioleta@putnaminv.com Tue Aug 02 14:20:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 02 Aug 2011 14:20:50 -0700 Received: from [115.22.52.38] (helo=7q2aesmdrvvl.x0uranb) by lists.xensource.com with esmtp (Exim 4.43) id 1QoMOP-0003Eg-9y; Tue, 02 Aug 2011 14:20:50 -0700 Subject: Watch Replica - Specialists in replica watches, quality replica rolex watch dealer Message-ID: <51d47u77a49-99500407-281g9n81@nordyqvztf> From: "Lorena Concha" Date: Tue, 02 Aug 2011 15:15:19 -0700 MIME-Version: 1.0 To: Content-Type: multipart/alternative; boundary="----=_NextPart_007_093B_C9561A42.3817DA65" ------=_NextPart_007_093B_C9561A42.3817DA65 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Watch Replica - Specialists replica watches, quality replica.. Watch Replica - Specialists in replica watches, quality replica rolex watch dealer http://replicaswatchcar.ru ------=_NextPart_007_093B_C9561A42.3817DA65 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit
Watch Replica - Specialists replica watches, quality replica..
Specialists in replica watches, quality replica rolex watch dealer
------=_NextPart_007_093B_C9561A42.3817DA65-- From xen-changelog-bounces@lists.xensource.com Wed Aug 03 11:33:14 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 11:33:14 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QogFm-0006LQ-6D; Wed, 03 Aug 2011 11:33:14 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QogFh-0006Kl-Uf for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 11:33:10 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QogFg-0006yk-GQ for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 19:33:08 +0100 Message-Id: Date: Wed, 03 Aug 2011 19:33:07 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] VT-d: always clean up dpci timers. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1311608919 -3600 # Node ID cb22fa57ff252893b6adb1481e09b1287eacd990 # Parent 4d5c76248de3d2b5385496b6ec5a33771cc74283 VT-d: always clean up dpci timers. If a VM has all its PCI devices deassigned, need_iommu(d) becomes false but it might still have DPCI EOI timers that were init_timer()d but not yet kill_timer()d. That causes xen to crash later because the linked list of inactive timers gets corrupted, e.g.: (XEN) Xen call trace: (XEN) [] set_timer+0x1c2/0x24f (XEN) [] schedule+0x129/0x5dd (XEN) [] __do_softirq+0x7e/0x89 (XEN) [] do_softirq+0x26/0x28 (XEN) [] idle_loop+0x5a/0x5c (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Assertion 'entry->next->prev == entry' failed at /local/scratch/tdeegan/xen-unstable.hg/xen/include:172 (XEN) **************************************** The following patch makes sure that the domain destruction path always clears up the DPCI state even if !needs_iommu(d). Signed-off-by: Tim Deegan xen-unstable changeset: 23746:aa54b8175954 xen-unstable date: Mon Jul 25 16:41:33 2011 +0100 --- diff -r 4d5c76248de3 -r cb22fa57ff25 xen/drivers/passthrough/pci.c --- a/xen/drivers/passthrough/pci.c Sat Jul 23 09:01:25 2011 +0100 +++ b/xen/drivers/passthrough/pci.c Mon Jul 25 16:48:39 2011 +0100 @@ -252,9 +252,6 @@ if ( !iommu_enabled ) return; - if ( !need_iommu(d) ) - return; - spin_lock(&d->event_lock); hvm_irq_dpci = domain_get_irq_dpci(d); if ( hvm_irq_dpci != NULL ) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:45:31 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:45:31 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiJn-0005ce-Fh; Wed, 03 Aug 2011 13:45:31 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIU-00057c-9p for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIT-0000AJ-Hv for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:09 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86, mce: Dump mce log by ERST when mc panic X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Liu, Jinsong # Date 1311407818 -3600 # Node ID 3d18ff6589e33646a43d059106bb53264ce251ca # Parent 31683aa4bfb38376cf98e0e45b4f34f80c1c21be x86, mce: Dump mce log by ERST when mc panic We have implemented basic ERST logic before. Now linux3.0 as dom0 has included APEI logic. Hence it's time to add mce apei interface and enable APEI ERST feature. With it, it can save mce log by ERST method when mc panic. Signed-off-by: Liu, Jinsong --- diff -r 31683aa4bfb3 -r 3d18ff6589e3 xen/arch/x86/cpu/mcheck/mce.c --- a/xen/arch/x86/cpu/mcheck/mce.c Sat Jul 23 08:55:59 2011 +0100 +++ b/xen/arch/x86/cpu/mcheck/mce.c Sat Jul 23 08:56:58 2011 +0100 @@ -919,6 +919,28 @@ return buf; } +static void x86_mcinfo_apei_save( + struct mcinfo_global *mc_global, struct mcinfo_bank *mc_bank) +{ + struct mce m; + + memset(&m, 0, sizeof(struct mce)); + + m.cpu = mc_global->mc_coreid; + m.cpuvendor = boot_cpu_data.x86_vendor; + m.cpuid = cpuid_eax(1); + m.socketid = mc_global->mc_socketid; + m.apicid = mc_global->mc_apicid; + + m.mcgstatus = mc_global->mc_gstatus; + m.status = mc_bank->mc_status; + m.misc = mc_bank->mc_misc; + m.addr = mc_bank->mc_addr; + m.bank = mc_bank->mc_bank; + + apei_write_mce(&m); +} + /* Dump machine check information in a format, * mcelog can parse. This is used only when * Dom0 does not take the notification. */ @@ -962,8 +984,11 @@ printk("[%16"PRIx64"]", mc_bank->mc_misc); if (mc_bank->mc_status & MCi_STATUS_ADDRV) printk(" at %16"PRIx64, mc_bank->mc_addr); + printk("\n"); - printk("\n"); + if (is_mc_panic) + x86_mcinfo_apei_save(mc_global, mc_bank); + next: mic = x86_mcinfo_next(mic); /* next entry */ if ((mic == NULL) || (mic->size == 0)) diff -r 31683aa4bfb3 -r 3d18ff6589e3 xen/arch/x86/cpu/mcheck/mce.h --- a/xen/arch/x86/cpu/mcheck/mce.h Sat Jul 23 08:55:59 2011 +0100 +++ b/xen/arch/x86/cpu/mcheck/mce.h Sat Jul 23 08:56:58 2011 +0100 @@ -210,4 +210,6 @@ __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */ }; +extern int apei_write_mce(struct mce *m); + #endif /* _MCE_H */ diff -r 31683aa4bfb3 -r 3d18ff6589e3 xen/arch/x86/cpu/mcheck/mce_intel.c --- a/xen/arch/x86/cpu/mcheck/mce_intel.c Sat Jul 23 08:55:59 2011 +0100 +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c Sat Jul 23 08:56:58 2011 +0100 @@ -283,6 +283,7 @@ { case MCER_RESET: dprintk(XENLOG_ERR, "MCE delayed action failed\n"); + is_mc_panic = 1; x86_mcinfo_dump(mctelem_dataptr(mctc)); panic("MCE: Software recovery failed for the UCR\n"); break; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:45:42 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:45:42 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiJy-0005gQ-Do; Wed, 03 Aug 2011 13:45:42 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIT-00057a-Py for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIT-0000A4-2W for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:09 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] acpi: Add support for old and new bios erst, enable mce_apei logic X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Liu, Jinsong # Date 1311407759 -3600 # Node ID 31683aa4bfb38376cf98e0e45b4f34f80c1c21be # Parent 537918f518eec3d8e2e2dad403fce40303321523 acpi: Add support for old and new bios erst, enable mce_apei logic When testing, we found different bios has different understanding about APEI ERST table header, depending on whether it count ACPI standard header or not. This patch add support for both bios version, and enable mce_apei. Signed-off-by: Liu, Jinsong --- diff -r 537918f518ee -r 31683aa4bfb3 xen/arch/x86/cpu/mcheck/Makefile --- a/xen/arch/x86/cpu/mcheck/Makefile Sat Jul 23 08:49:15 2011 +0100 +++ b/xen/arch/x86/cpu/mcheck/Makefile Sat Jul 23 08:55:59 2011 +0100 @@ -4,7 +4,7 @@ obj-y += amd_f10.o obj-y += mctelem.o obj-y += mce.o -#obj-y += mce-apei.o +obj-y += mce-apei.o obj-y += mce_intel.o obj-y += mce_amd_quirks.o obj-y += non-fatal.o diff -r 537918f518ee -r 31683aa4bfb3 xen/drivers/acpi/apei/erst.c --- a/xen/drivers/acpi/apei/erst.c Sat Jul 23 08:49:15 2011 +0100 +++ b/xen/drivers/acpi/apei/erst.c Sat Jul 23 08:55:59 2011 +0100 @@ -715,7 +715,13 @@ static int __init erst_check_table(struct acpi_table_erst *erst_tab) { - if (erst_tab->header_length != sizeof(struct acpi_table_erst)) + /* + * Some old BIOSes include the ACPI standard header in the ERST header + * length; new BIOSes do not. Our check allows for both methods. + */ + if ((erst_tab->header_length != + (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) + && (erst_tab->header_length != sizeof(struct acpi_table_erst))) return -EINVAL; if (erst_tab->header.length < sizeof(struct acpi_table_erst)) return -EINVAL; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:45:49 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:45:49 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiK5-0005kp-IL; Wed, 03 Aug 2011 13:45:49 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIT-00057Z-PP for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIS-00009p-Hm for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:08 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:07 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] add privileged (dom0) kernel feature indication X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1311407355 -3600 # Node ID 537918f518eec3d8e2e2dad403fce40303321523 # Parent 42edf1481c5704c8ce1eb171a713b5411df0551a add privileged (dom0) kernel feature indication With our switching away from supporting 32-bit Dom0 operation, users complained that attempts (perhaps due to lack of knowledge of that change) to boot the no longer privileged kernel in Dom0 resulted in apparently silent failure. To make the mismatch explicit and visible, add dom0 feature flag that the kernel can set to indicate operation as dom0 is supported. Due to the way elf_xen_parse_features() worked up to now (getting fixed here), adding features indications to the old, string based ELF note would make the respective kernel unusable on older hypervisors. For that reason, a new ELF Note is being introduced that allows specifying supported features as a bit array instead (with features unknown to the hypervisor simply ignored, as now also done by elf_xen_parse_features(), whereas here unknown kernel-required features still keep the kernel [and hence VM] from booting). Introduce and use elf_note_numeric_array() to be forward compatible (or else an old hypervisor wouldn't be able to parse kernel specified features occupying more than 64 bits - thanks, Ian!). Signed-off-by: Jan Beulich --- diff -r 42edf1481c57 -r 537918f518ee tools/libxc/xc_dom_elfloader.c --- a/tools/libxc/xc_dom_elfloader.c Fri Jul 22 08:55:19 2011 +0100 +++ b/tools/libxc/xc_dom_elfloader.c Sat Jul 23 08:49:15 2011 +0100 @@ -286,6 +286,13 @@ if ( (rc = elf_xen_parse(elf, &dom->parms)) != 0 ) return rc; + if ( elf_xen_feature_get(XENFEAT_dom0, dom->parms.f_required) ) + { + xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: Kernel does not" + " support unprivileged (DomU) operation", __FUNCTION__); + return -EINVAL; + } + /* find kernel segment */ dom->kernel_seg.vstart = dom->parms.virt_kstart; dom->kernel_seg.vend = dom->parms.virt_kend; diff -r 42edf1481c57 -r 537918f518ee xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/arch/ia64/xen/domain.c Sat Jul 23 08:49:15 2011 +0100 @@ -2164,6 +2164,13 @@ return -1; } + if (parms.elf_notes[XEN_ELFNOTE_FEATURES].type != XEN_ENT_NONE && + !test_bit(XENFEAT_dom0, parms.f_supported)) + { + printk("Kernel does not support Dom0 operation\n"); + return -1; + } + p_start = parms.virt_base; pkern_start = parms.virt_kstart; pkern_end = parms.virt_kend; diff -r 42edf1481c57 -r 537918f518ee xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/arch/x86/domain_build.c Sat Jul 23 08:49:15 2011 +0100 @@ -415,6 +415,13 @@ return -EINVAL; } + if ( parms.elf_notes[XEN_ELFNOTE_FEATURES].type != XEN_ENT_NONE && + !test_bit(XENFEAT_dom0, parms.f_supported) ) + { + printk("Kernel does not support Dom0 operation\n"); + return -EINVAL; + } + #if defined(__x86_64__) if ( compat32 ) { diff -r 42edf1481c57 -r 537918f518ee xen/common/kernel.c --- a/xen/common/kernel.c Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/common/kernel.c Sat Jul 23 08:49:15 2011 +0100 @@ -287,6 +287,8 @@ (1U << XENFEAT_auto_translated_physmap); if ( supervisor_mode_kernel ) fi.submap |= 1U << XENFEAT_supervisor_mode_kernel; + if ( current->domain == dom0 ) + fi.submap |= 1U << XENFEAT_dom0; #ifdef CONFIG_X86 if ( !is_hvm_vcpu(current) ) fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) | diff -r 42edf1481c57 -r 537918f518ee xen/common/libelf/libelf-dominfo.c --- a/xen/common/libelf/libelf-dominfo.c Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/common/libelf/libelf-dominfo.c Sat Jul 23 08:49:15 2011 +0100 @@ -26,7 +26,8 @@ [XENFEAT_writable_descriptor_tables] = "writable_descriptor_tables", [XENFEAT_auto_translated_physmap] = "auto_translated_physmap", [XENFEAT_supervisor_mode_kernel] = "supervisor_mode_kernel", - [XENFEAT_pae_pgdir_above_4gb] = "pae_pgdir_above_4gb" + [XENFEAT_pae_pgdir_above_4gb] = "pae_pgdir_above_4gb", + [XENFEAT_dom0] = "dom0" }; static const int elf_xen_features = sizeof(elf_xen_feature_names) / sizeof(elf_xen_feature_names[0]); @@ -83,7 +84,7 @@ } } } - if ( i == elf_xen_features ) + if ( i == elf_xen_features && required && feature[0] == '!' ) return -1; } @@ -114,6 +115,7 @@ [XEN_ELFNOTE_LOADER] = { "LOADER", 1}, [XEN_ELFNOTE_PAE_MODE] = { "PAE_MODE", 1}, [XEN_ELFNOTE_FEATURES] = { "FEATURES", 1}, + [XEN_ELFNOTE_SUPPORTED_FEATURES] = { "SUPPORTED_FEATURES", 0}, [XEN_ELFNOTE_BSD_SYMTAB] = { "BSD_SYMTAB", 1}, [XEN_ELFNOTE_SUSPEND_CANCEL] = { "SUSPEND_CANCEL", 0 }, [XEN_ELFNOTE_MOD_START_PFN] = { "MOD_START_PFN", 0 }, @@ -122,6 +124,7 @@ const char *str = NULL; uint64_t val = 0; + unsigned int i; int type = elf_uval(elf, note, type); if ( (type >= sizeof(note_desc) / sizeof(note_desc[0])) || @@ -200,6 +203,12 @@ return -1; break; + case XEN_ELFNOTE_SUPPORTED_FEATURES: + for ( i = 0; i < XENFEAT_NR_SUBMAPS; ++i ) + parms->f_supported[i] |= elf_note_numeric_array( + elf, note, sizeof(*parms->f_supported), i); + break; + } return 0; } diff -r 42edf1481c57 -r 537918f518ee xen/common/libelf/libelf-tools.c --- a/xen/common/libelf/libelf-tools.c Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/common/libelf/libelf-tools.c Sat Jul 23 08:49:15 2011 +0100 @@ -227,6 +227,27 @@ return 0; } } + +uint64_t elf_note_numeric_array(struct elf_binary *elf, const elf_note *note, + unsigned int unitsz, unsigned int idx) +{ + const void *desc = elf_note_desc(elf, note); + int descsz = elf_uval(elf, note, descsz); + + if ( descsz % unitsz || idx >= descsz / unitsz ) + return 0; + switch (unitsz) + { + case 1: + case 2: + case 4: + case 8: + return elf_access_unsigned(elf, desc, idx * unitsz, unitsz); + default: + return 0; + } +} + const elf_note *elf_note_next(struct elf_binary *elf, const elf_note * note) { int namesz = (elf_uval(elf, note, namesz) + 3) & ~3; diff -r 42edf1481c57 -r 537918f518ee xen/include/public/elfnote.h --- a/xen/include/public/elfnote.h Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/include/public/elfnote.h Sat Jul 23 08:49:15 2011 +0100 @@ -179,9 +179,22 @@ #define XEN_ELFNOTE_MOD_START_PFN 16 /* + * The features supported by this kernel (numeric). + * + * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a + * kernel to specify support for features that older hypervisors don't + * know about. The set of features 4.2 and newer hypervisors will + * consider supported by the kernel is the combination of the sets + * specified through this and the string note. + * + * LEGACY: FEATURES + */ +#define XEN_ELFNOTE_SUPPORTED_FEATURES 17 + +/* * The number of the highest elfnote defined. */ -#define XEN_ELFNOTE_MAX XEN_ELFNOTE_MOD_START_PFN +#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUPPORTED_FEATURES /* * System information exported through crash notes. diff -r 42edf1481c57 -r 537918f518ee xen/include/public/features.h --- a/xen/include/public/features.h Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/include/public/features.h Sat Jul 23 08:49:15 2011 +0100 @@ -75,7 +75,10 @@ #define XENFEAT_hvm_safe_pvclock 9 /* x86: pirq can be used by HVM guests */ -#define XENFEAT_hvm_pirqs 10 +#define XENFEAT_hvm_pirqs 10 + +/* operation as Dom0 is supported */ +#define XENFEAT_dom0 11 #define XENFEAT_NR_SUBMAPS 1 diff -r 42edf1481c57 -r 537918f518ee xen/include/xen/libelf.h --- a/xen/include/xen/libelf.h Fri Jul 22 08:55:19 2011 +0100 +++ b/xen/include/xen/libelf.h Sat Jul 23 08:49:15 2011 +0100 @@ -179,6 +179,8 @@ const char *elf_note_name(struct elf_binary *elf, const elf_note * note); const void *elf_note_desc(struct elf_binary *elf, const elf_note * note); uint64_t elf_note_numeric(struct elf_binary *elf, const elf_note * note); +uint64_t elf_note_numeric_array(struct elf_binary *, const elf_note *, + unsigned int unitsz, unsigned int idx); const elf_note *elf_note_next(struct elf_binary *elf, const elf_note * note); int elf_is_elfbinary(const void *image); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:45:57 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:45:57 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiKD-0005ny-Cq; Wed, 03 Aug 2011 13:45:57 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIU-00057k-PY for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIU-0000AY-0z for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:10 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] xend: remove PCI device listing from NetBSD, since it's Linux X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Roger Pau Monne # Date 1311407917 -3600 # Node ID 88847c424eec8c5d5df79fc5e961660fe31d83ec # Parent 3d18ff6589e33646a43d059106bb53264ce251ca xend: remove PCI device listing from NetBSD, since it's Linux specific code. Signed-off-by: Roger Pau Monne --- diff -r 3d18ff6589e3 -r 88847c424eec tools/python/xen/util/pci.py --- a/tools/python/xen/util/pci.py Sat Jul 23 08:56:58 2011 +0100 +++ b/tools/python/xen/util/pci.py Sat Jul 23 08:58:37 2011 +0100 @@ -462,6 +462,7 @@ return None def get_all_pci_names(): + if not sys.platform.startswith('linux'): return [] sysfs_mnt = find_sysfs_mnt() if sysfs_mnt is None: return None _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:04 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:04 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiKK-0005ri-1P; Wed, 03 Aug 2011 13:46:04 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIW-00058K-7J for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:12 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIV-0000BG-Fq for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:11 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: Declare get_hvm_info_table/get_shared_info as const funcs. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311411424 -3600 # Node ID d8725d9fb8657874011d2f2772f5e970b24dfe9b # Parent 5f7dc61e166bab47294fbb4be8b4e05d137562b4 hvmloader: Declare get_hvm_info_table/get_shared_info as const funcs. The compiler can perform CSE on their call sites. Signed-off-by: Keir Fraser --- diff -r 5f7dc61e166b -r d8725d9fb865 tools/firmware/hvmloader/config.h --- a/tools/firmware/hvmloader/config.h Sat Jul 23 09:56:13 2011 +0100 +++ b/tools/firmware/hvmloader/config.h Sat Jul 23 09:57:04 2011 +0100 @@ -55,9 +55,8 @@ #define PCI_MEM_END 0xfc000000 extern unsigned long pci_mem_start, pci_mem_end; -/* We reserve 16MB for special BIOS mappings, etc. */ +/* Reserved for special BIOS mappings, etc. */ #define RESERVED_MEMBASE 0xfc000000 -#define RESERVED_MEMSIZE 0x01000000 /* Memory map. */ #define SCRATCH_PHYSICAL_ADDRESS 0x00010000 _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:11 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:11 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiKR-0005uy-4v; Wed, 03 Aug 2011 13:46:11 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIV-00057v-Oc for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:12 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIV-0000B1-0f for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:11 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: Remove bogus and unused RESERVED_MEMSIZE decl. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311411373 -3600 # Node ID 5f7dc61e166bab47294fbb4be8b4e05d137562b4 # Parent 815ef5cf02613b9d21e2c9837760278516a69965 hvmloader: Remove bogus and unused RESERVED_MEMSIZE decl. Signed-off-by: Keir Fraser --- diff -r 815ef5cf0261 -r 5f7dc61e166b tools/firmware/hvmloader/util.h --- a/tools/firmware/hvmloader/util.h Sat Jul 23 09:43:47 2011 +0100 +++ b/tools/firmware/hvmloader/util.h Sat Jul 23 09:56:13 2011 +0100 @@ -81,7 +81,7 @@ #define pci_writel(devfn, reg, val) (pci_write(devfn, reg, 4, (uint32_t)val)) /* Get a pointer to the shared-info page */ -struct shared_info *get_shared_info(void); +struct shared_info *get_shared_info(void) __attribute__ ((const)); /* Get CPU speed in MHz. */ uint16_t get_cpu_mhz(void); @@ -138,7 +138,7 @@ }) /* HVM-builder info. */ -struct hvm_info_table *get_hvm_info_table(void); +struct hvm_info_table *get_hvm_info_table(void) __attribute__ ((const)); #define hvm_info (get_hvm_info_table()) /* String and memory functions */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:17 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:17 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiKX-0005yU-Rh; Wed, 03 Aug 2011 13:46:17 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIX-00058Q-6X for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:13 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIW-0000Bk-EY for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:12 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: Replace bios_relocate hook with bios_load hook X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311598669 -3600 # Node ID 360b31a5263cf60081cd6dd41c1c7858fcaccbc6 # Parent 50ddc200a60cad3929a79a992f09145fd39af49d hvmloader: Replace bios_relocate hook with bios_load hook Used by OVMF BIOS handler. Signed-off-by: Bei Guan Signed-off-by: Keir Fraser --- diff -r 50ddc200a60c -r 360b31a5263c tools/firmware/hvmloader/config.h --- a/tools/firmware/hvmloader/config.h Mon Jul 25 13:48:08 2011 +0100 +++ b/tools/firmware/hvmloader/config.h Mon Jul 25 13:57:49 2011 +0100 @@ -20,11 +20,11 @@ int load_roms; unsigned int optionrom_start, optionrom_end; + void (*bios_load)(const struct bios_config *config); + void (*bios_info_setup)(void); void (*bios_info_finish)(void); - void (*bios_relocate)(void); - void (*vm86_setup)(void); void (*e820_setup)(void); diff -r 50ddc200a60c -r 360b31a5263c tools/firmware/hvmloader/hvmloader.c --- a/tools/firmware/hvmloader/hvmloader.c Mon Jul 25 13:48:08 2011 +0100 +++ b/tools/firmware/hvmloader/hvmloader.c Mon Jul 25 13:57:49 2011 +0100 @@ -416,12 +416,13 @@ bios->create_smbios_tables(); } - printf("Loading %s ...\n", bios->name); - memcpy((void *)bios->bios_address, bios->image, - bios->image_size); - - if (bios->bios_relocate) - bios->bios_relocate(); + if (bios->bios_load) { + bios->bios_load(bios); + } else { + printf("Loading %s ...\n", bios->name); + memcpy((void *)bios->bios_address, bios->image, + bios->image_size); + } if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode ) { if ( bios->create_mp_tables ) diff -r 50ddc200a60c -r 360b31a5263c tools/firmware/hvmloader/rombios.c --- a/tools/firmware/hvmloader/rombios.c Mon Jul 25 13:48:08 2011 +0100 +++ b/tools/firmware/hvmloader/rombios.c Mon Jul 25 13:57:49 2011 +0100 @@ -81,11 +81,15 @@ memset(info, 0, sizeof(*info)); } -static void rombios_relocate(void) +static void rombios_load(const struct bios_config *config) { uint32_t bioshigh; struct rombios_info *info; + printf("Loading %s ...\n", config->name); + memcpy((void *)config->bios_address, config->image, + config->image_size); + bioshigh = rombios_highbios_setup(); info = (struct rombios_info *)BIOS_INFO_PHYSICAL_ADDRESS; @@ -169,11 +173,11 @@ .optionrom_start = OPTIONROM_PHYSICAL_ADDRESS, .optionrom_end = OPTIONROM_PHYSICAL_END, + .bios_load = rombios_load, + .bios_info_setup = rombios_setup_bios_info, .bios_info_finish = NULL, - .bios_relocate = rombios_relocate, - .vm86_setup = rombios_init_vm86_tss, .e820_setup = rombios_setup_e820, diff -r 50ddc200a60c -r 360b31a5263c tools/firmware/hvmloader/seabios.c --- a/tools/firmware/hvmloader/seabios.c Mon Jul 25 13:48:08 2011 +0100 +++ b/tools/firmware/hvmloader/seabios.c Mon Jul 25 13:57:49 2011 +0100 @@ -138,11 +138,11 @@ .optionrom_start = 0, .optionrom_end = 0, + .bios_load = NULL, + .bios_info_setup = seabios_setup_bios_info, .bios_info_finish = seabios_finish_bios_info, - .bios_relocate = NULL, - .vm86_setup = NULL, .e820_setup = seabios_setup_e820, _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:24 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:24 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiKd-00061e-S5; Wed, 03 Aug 2011 13:46:24 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIW-00058N-Mr for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:13 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIV-0000BV-Vg for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:11 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] fix regression from c/s 23735:537918f518ee X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1311598088 -3600 # Node ID 50ddc200a60cad3929a79a992f09145fd39af49d # Parent d8725d9fb8657874011d2f2772f5e970b24dfe9b fix regression from c/s 23735:537918f518ee This was checking presence of the wrong (old) ELF note. I don't really understand how this failed consistently only for one of the xen-boot tests... Signed-off-by: Jan Beulich --- diff -r d8725d9fb865 -r 50ddc200a60c xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Sat Jul 23 09:57:04 2011 +0100 +++ b/xen/arch/ia64/xen/domain.c Mon Jul 25 13:48:08 2011 +0100 @@ -2164,7 +2164,7 @@ return -1; } - if (parms.elf_notes[XEN_ELFNOTE_FEATURES].type != XEN_ENT_NONE && + if (parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE && !test_bit(XENFEAT_dom0, parms.f_supported)) { printk("Kernel does not support Dom0 operation\n"); diff -r d8725d9fb865 -r 50ddc200a60c xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Sat Jul 23 09:57:04 2011 +0100 +++ b/xen/arch/x86/domain_build.c Mon Jul 25 13:48:08 2011 +0100 @@ -415,7 +415,7 @@ return -EINVAL; } - if ( parms.elf_notes[XEN_ELFNOTE_FEATURES].type != XEN_ENT_NONE && + if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE && !test_bit(XENFEAT_dom0, parms.f_supported) ) { printk("Kernel does not support Dom0 operation\n"); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:34 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:34 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiKn-00065b-Ua; Wed, 03 Aug 2011 13:46:33 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIX-00058R-LW for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:14 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIW-0000Bz-UC for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:12 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:12 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: Formatting cleanups. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311599381 -3600 # Node ID 3244ff483d615f4ab1d938a240052154c13a62f8 # Parent 360b31a5263cf60081cd6dd41c1c7858fcaccbc6 hvmloader: Formatting cleanups. Signed-off-by: Keir Fraser --- diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/e820.c --- a/tools/firmware/hvmloader/e820.c Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/e820.c Mon Jul 25 14:09:41 2011 +0100 @@ -91,7 +91,8 @@ ASSERT ( bios_image_base < 0x100000 ); - if ( lowmem_reserved_base < ACPI_INFO_PHYSICAL_ADDRESS ) { + if ( lowmem_reserved_base < ACPI_INFO_PHYSICAL_ADDRESS ) + { /* * 0x0-lowmem_reserved_base: Ordinary RAM. */ diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/hvmloader.c --- a/tools/firmware/hvmloader/hvmloader.c Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/hvmloader.c Mon Jul 25 14:09:41 2011 +0100 @@ -408,23 +408,24 @@ perform_tests(); - if (bios->bios_info_setup) + if ( bios->bios_info_setup ) bios->bios_info_setup(); - if (bios->create_smbios_tables) { + if ( bios->create_smbios_tables ) + { printf("Writing SMBIOS tables ...\n"); bios->create_smbios_tables(); } - if (bios->bios_load) { + printf("Loading %s ...\n", bios->name); + if ( bios->bios_load ) bios->bios_load(bios); - } else { - printf("Loading %s ...\n", bios->name); + else memcpy((void *)bios->bios_address, bios->image, bios->image_size); - } - if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode ) { + if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode ) + { if ( bios->create_mp_tables ) bios->create_mp_tables(); if ( bios->create_pir_tables ) @@ -476,14 +477,16 @@ .value = 1, }; - if ( bios->acpi_build_tables ) { + if ( bios->acpi_build_tables ) + { printf("Loading ACPI ...\n"); bios->acpi_build_tables(); } + hypercall_hvm_op(HVMOP_set_param, &p); } - if (bios->vm86_setup) + if ( bios->vm86_setup ) bios->vm86_setup(); cmos_write_memory_size(); @@ -508,10 +511,10 @@ bios->bios_address, bios->bios_address + bios->image_size - 1); - if (bios->e820_setup) + if ( bios->e820_setup ) bios->e820_setup(); - if (bios->bios_info_finish) + if ( bios->bios_info_finish ) bios->bios_info_finish(); xenbus_shutdown(); diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/mp_tables.c --- a/tools/firmware/hvmloader/mp_tables.c Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/mp_tables.c Mon Jul 25 14:09:41 2011 +0100 @@ -211,7 +211,8 @@ /* fills in an MP bus entry of type 'type' and bus ID 'bus_id' */ -static void fill_mp_bus_entry(struct mp_bus_entry *mpbe, int bus_id, const char *type) +static void fill_mp_bus_entry( + struct mp_bus_entry *mpbe, int bus_id, const char *type) { int i; @@ -272,7 +273,8 @@ printf("Creating MP tables ...\n"); - if (!_mpfps) { + if ( _mpfps == NULL ) + { int sz; sz = sizeof(struct mp_floating_pointer_struct); @@ -282,7 +284,7 @@ sz += sizeof(struct mp_ioapic_entry); sz += sizeof(struct mp_io_intr_entry) * 16; - base = mem_alloc(sz, 0); + _mpfps = mem_alloc(sz, 0); } mpfps = _mpfps; diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/pir.c --- a/tools/firmware/hvmloader/pir.c Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/pir.c Mon Jul 25 14:09:41 2011 +0100 @@ -23,7 +23,8 @@ */ unsigned long create_pir_tables(void) { - int length = sizeof(struct pir_table) + sizeof(struct pir_slot)*NR_PIR_SLOTS; + int length = sizeof(struct pir_table) + + sizeof(struct pir_slot) * NR_PIR_SLOTS; struct pir_table *pir = scratch_alloc(length, 0); int i, checksum; @@ -57,10 +58,8 @@ } checksum = 0; - for ( i = 0; i < length; i++) - { + for ( i = 0; i < length; i++ ) checksum += ((int8_t *)pir)[i]; - } pir->checksum = -checksum; return (unsigned long)pir; diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/rombios.c --- a/tools/firmware/hvmloader/rombios.c Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/rombios.c Mon Jul 25 14:09:41 2011 +0100 @@ -86,7 +86,6 @@ uint32_t bioshigh; struct rombios_info *info; - printf("Loading %s ...\n", config->name); memcpy((void *)config->bios_address, config->image, config->image_size); @@ -110,7 +109,7 @@ bios_mem != (char *)ROMBIOS_END; bios_mem++ ) { - if ( strncmp(bios_mem, "___HVMMP", 8) == 0) + if ( strncmp(bios_mem, "___HVMMP", 8) == 0 ) return bios_mem; } @@ -124,7 +123,7 @@ uint8_t checksum; checksum = 0; - for (i = 0; i < ROMBIOS_MAXOFFSET; ++i) + for ( i = 0; i < ROMBIOS_MAXOFFSET; i++ ) checksum += ((uint8_t *)(ROMBIOS_BEGIN))[i]; *((uint8_t *)(ROMBIOS_BEGIN + ROMBIOS_MAXOFFSET)) = -checksum; @@ -153,9 +152,10 @@ static void rombios_create_smbios_tables(void) { - hvm_write_smbios_tables(SMBIOS_PHYSICAL_ADDRESS, - SMBIOS_PHYSICAL_ADDRESS + sizeof(struct smbios_entry_point), - SMBIOS_PHYSICAL_END); + hvm_write_smbios_tables( + SMBIOS_PHYSICAL_ADDRESS, + SMBIOS_PHYSICAL_ADDRESS + sizeof(struct smbios_entry_point), + SMBIOS_PHYSICAL_END); } //BUILD_BUG_ON(sizeof(rombios) > (0x00100000U - ROMBIOS_PHYSICAL_ADDRESS)); diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/seabios.c --- a/tools/firmware/hvmloader/seabios.c Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/seabios.c Mon Jul 25 14:09:41 2011 +0100 @@ -71,7 +71,7 @@ uint8_t checksum; checksum = 0; - for (i = 0; i < info->length; ++i) + for ( i = 0; i < info->length; i++ ) checksum += ((uint8_t *)(info))[i]; info->checksum = -checksum; diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/smbios.c --- a/tools/firmware/hvmloader/smbios.c Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/smbios.c Mon Jul 25 14:09:41 2011 +0100 @@ -77,9 +77,9 @@ cpuid(0, &eax, (uint32_t *)&id[0], (uint32_t *)&id[8], (uint32_t *)&id[4]); - if (memcmp(id, "GenuineIntel", 12) == 0) + if ( memcmp(id, "GenuineIntel", 12) == 0 ) strncpy(buf, "Intel", len); - else if (memcmp(id, "AuthenticAMD", 12) == 0) + else if ( memcmp(id, "AuthenticAMD", 12) == 0 ) strncpy(buf, "AMD", len); else strncpy(buf, "unknown", len); @@ -158,7 +158,8 @@ } void -hvm_write_smbios_tables(unsigned long ep, unsigned long smbios_start, unsigned long smbios_end) +hvm_write_smbios_tables( + unsigned long ep, unsigned long smbios_start, unsigned long smbios_end) { xen_domain_handle_t uuid; uint16_t xen_major_version, xen_minor_version; @@ -232,7 +233,8 @@ memcpy((void *)smbios_start, (void *)scratch_start, len); - smbios_entry_point_init((void *)ep, max_struct_size, len, smbios_start, nr_structs); + smbios_entry_point_init( + (void *)ep, max_struct_size, len, smbios_start, nr_structs); return; @@ -313,12 +315,14 @@ p->embedded_controller_minor = 0xff; start += sizeof(struct smbios_type_0); - if ((s = xenstore_read("bios-strings/bios-vendor")) == NULL || *s == '\0') + if ( ((s = xenstore_read("bios-strings/bios-vendor")) == NULL) + || (*s == '\0') ) s = "Xen"; strcpy((char *)start, s); start += strlen(s) + 1; - if ((s = xenstore_read("bios-strings/bios-version")) == NULL || *s == '\0') + if ( ((s = xenstore_read("bios-strings/bios-version")) == NULL) + || (*s == '\0') ) s = xen_version; strcpy((char *)start, s); start += strlen(s) + 1; @@ -358,27 +362,27 @@ start += sizeof(struct smbios_type_1); - if ((s = xenstore_read("bios-strings/system-manufacturer")) == NULL - || *s == '\0') + if ( ((s = xenstore_read("bios-strings/system-manufacturer")) == NULL) + || (*s == '\0') ) s = "Xen"; strcpy((char *)start, s); start += strlen(s) + 1; - if ((s = xenstore_read("bios-strings/system-product-name")) == NULL - || *s == '\0') + if ( ((s = xenstore_read("bios-strings/system-product-name")) == NULL) + || (*s == '\0') ) s = "HVM domU"; strcpy((char *)start, s); start += strlen(s) + 1; - if ((s = xenstore_read("bios-strings/system-version")) == NULL - || *s == '\0') + if ( ((s = xenstore_read("bios-strings/system-version")) == NULL) + || (*s == '\0') ) s = xen_version; strcpy((char *)start, s); start += strlen(s) + 1; uuid_to_string(uuid_str, uuid); - if ((s = xenstore_read("bios-strings/system-serial-number")) == NULL - || *s == '\0') + if ( ((s = xenstore_read("bios-strings/system-serial-number")) == NULL) + || (*s == '\0') ) s = uuid_str; strcpy((char *)start, s); start += strlen(s) + 1; @@ -486,10 +490,11 @@ start += sizeof(struct smbios_type_11); /* Pull out as many oem-* strings we find in xenstore */ - for (i = 1; i < 100; i++) { + for ( i = 1; i < 100; i++ ) + { path[(sizeof path) - 3] = '0' + ((i < 10) ? i : i / 10); path[(sizeof path) - 2] = (i < 10) ? '\0' : '0' + (i % 10); - if ((s = xenstore_read(path)) == NULL || *s == '\0') + if ( ((s = xenstore_read(path)) == NULL) || (*s == '\0') ) break; strcpy((char *)start, s); start += strlen(s) + 1; @@ -497,7 +502,8 @@ } /* Make sure there's at least one type-11 string */ - if (p->count == 0) { + if ( p->count == 0 ) + { strcpy((char *)start, "Xen"); start += strlen("Xen") + 1; p->count++; diff -r 360b31a5263c -r 3244ff483d61 tools/firmware/hvmloader/util.h --- a/tools/firmware/hvmloader/util.h Mon Jul 25 13:57:49 2011 +0100 +++ b/tools/firmware/hvmloader/util.h Mon Jul 25 14:09:41 2011 +0100 @@ -199,9 +199,8 @@ /* Miscellaneous. */ void cacheattr_init(void); unsigned long create_mp_tables(void *table); -void hvm_write_smbios_tables(unsigned long ep, - unsigned long smbios_start, - unsigned long smbios_end); +void hvm_write_smbios_tables( + unsigned long ep, unsigned long smbios_start, unsigned long smbios_end); unsigned long create_pir_tables(void); void smp_initialise(void); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:41 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:41 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiKu-00068s-Oc; Wed, 03 Aug 2011 13:46:40 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIY-00058l-4j for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:14 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIX-0000CE-DS for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:13 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:12 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: Allow default response to be specified to xenstore_read(). X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311600073 -3600 # Node ID 9dbbf1631193bb6df679f5eaaee192ef4ef91fd9 # Parent 3244ff483d615f4ab1d938a240052154c13a62f8 hvmloader: Allow default response to be specified to xenstore_read(). Signed-off-by: Keir Fraser --- diff -r 3244ff483d61 -r 9dbbf1631193 tools/firmware/hvmloader/hvmloader.c --- a/tools/firmware/hvmloader/hvmloader.c Mon Jul 25 14:09:41 2011 +0100 +++ b/tools/firmware/hvmloader/hvmloader.c Mon Jul 25 14:21:13 2011 +0100 @@ -368,9 +368,7 @@ const struct bios_info *b; const char *bios; - bios = xenstore_read("hvmloader/bios"); - if ( !bios ) - bios = "rombios"; + bios = xenstore_read("hvmloader/bios", "rombios"); for ( b = &bios_configs[0]; b->key != NULL; b++ ) if ( !strcmp(bios, b->key) ) diff -r 3244ff483d61 -r 9dbbf1631193 tools/firmware/hvmloader/smbios.c --- a/tools/firmware/hvmloader/smbios.c Mon Jul 25 14:09:41 2011 +0100 +++ b/tools/firmware/hvmloader/smbios.c Mon Jul 25 14:21:13 2011 +0100 @@ -315,15 +315,11 @@ p->embedded_controller_minor = 0xff; start += sizeof(struct smbios_type_0); - if ( ((s = xenstore_read("bios-strings/bios-vendor")) == NULL) - || (*s == '\0') ) - s = "Xen"; + s = xenstore_read("bios-strings/bios-vendor", "Xen"); strcpy((char *)start, s); start += strlen(s) + 1; - if ( ((s = xenstore_read("bios-strings/bios-version")) == NULL) - || (*s == '\0') ) - s = xen_version; + s = xenstore_read("bios-strings/bios-version", xen_version); strcpy((char *)start, s); start += strlen(s) + 1; @@ -362,28 +358,20 @@ start += sizeof(struct smbios_type_1); - if ( ((s = xenstore_read("bios-strings/system-manufacturer")) == NULL) - || (*s == '\0') ) - s = "Xen"; + s = xenstore_read("bios-strings/system-manufacturer", "Xen"); strcpy((char *)start, s); start += strlen(s) + 1; - if ( ((s = xenstore_read("bios-strings/system-product-name")) == NULL) - || (*s == '\0') ) - s = "HVM domU"; + s = xenstore_read("bios-strings/system-product-name", "HVM domU"); strcpy((char *)start, s); start += strlen(s) + 1; - if ( ((s = xenstore_read("bios-strings/system-version")) == NULL) - || (*s == '\0') ) - s = xen_version; + s = xenstore_read("bios-strings/system-version", xen_version); strcpy((char *)start, s); start += strlen(s) + 1; uuid_to_string(uuid_str, uuid); - if ( ((s = xenstore_read("bios-strings/system-serial-number")) == NULL) - || (*s == '\0') ) - s = uuid_str; + s = xenstore_read("bios-strings/system-serial-number", uuid_str); strcpy((char *)start, s); start += strlen(s) + 1; @@ -494,7 +482,7 @@ { path[(sizeof path) - 3] = '0' + ((i < 10) ? i : i / 10); path[(sizeof path) - 2] = (i < 10) ? '\0' : '0' + (i % 10); - if ( ((s = xenstore_read(path)) == NULL) || (*s == '\0') ) + if ( ((s = xenstore_read(path, NULL)) == NULL) || (*s == '\0') ) break; strcpy((char *)start, s); start += strlen(s) + 1; diff -r 3244ff483d61 -r 9dbbf1631193 tools/firmware/hvmloader/util.h --- a/tools/firmware/hvmloader/util.h Mon Jul 25 14:09:41 2011 +0100 +++ b/tools/firmware/hvmloader/util.h Mon Jul 25 14:21:13 2011 +0100 @@ -187,8 +187,11 @@ /* Read a xenstore key. Returns a nul-terminated string (even if the XS * data wasn't nul-terminated) or NULL. The returned string is in a - * static buffer, so only valid until the next xenstore/xenbus operation. */ -char *xenstore_read(char *path); + * static buffer, so only valid until the next xenstore/xenbus operation. + * If @default_resp is specified, it is returned in preference to a NULL or + * empty string received from xenstore. + */ +const char *xenstore_read(const char *path, const char *default_resp); /* Setup PCI bus */ void pci_setup(void); diff -r 3244ff483d61 -r 9dbbf1631193 tools/firmware/hvmloader/xenbus.c --- a/tools/firmware/hvmloader/xenbus.c Mon Jul 25 14:09:41 2011 +0100 +++ b/tools/firmware/hvmloader/xenbus.c Mon Jul 25 14:21:13 2011 +0100 @@ -83,7 +83,7 @@ } /* Helper functions: copy data in and out of the ring */ -static void ring_write(char *data, uint32_t len) +static void ring_write(const char *data, uint32_t len) { uint32_t part; @@ -140,8 +140,8 @@ * Returns 0 for success, or an errno for error. * The answer is returned in a static buffer which is only * valid until the next call of xenbus_send(). */ -static int xenbus_send(uint32_t type, uint32_t len, char *data, - uint32_t *reply_len, char **reply_data) +static int xenbus_send(uint32_t type, uint32_t len, const char *data, + uint32_t *reply_len, const char **reply_data) { struct xsd_sockmsg hdr; evtchn_send_t send; @@ -190,15 +190,22 @@ /* Read a xenstore key. Returns a nul-terminated string (even if the XS * data wasn't nul-terminated) or NULL. The returned string is in a - * static buffer, so only valid until the next xenstore/xenbus operation. */ -char *xenstore_read(char *path) + * static buffer, so only valid until the next xenstore/xenbus operation. + * If @default_resp is specified, it is returned in preference to a NULL or + * empty string received from xenstore. + */ +const char *xenstore_read(const char *path, const char *default_resp) { uint32_t len = 0; - char *answer = NULL; + const char *answer = NULL; /* Include the nul in the request */ if ( xenbus_send(XS_READ, strlen(path) + 1, path, &len, &answer) ) - return NULL; + answer = NULL; + + if ( (default_resp != NULL) && ((answer == NULL) || (*answer == '\0')) ) + answer = default_resp; + /* We know xenbus_send() nul-terminates its answer, so just pass it on. */ return answer; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:48 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:48 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiL2-0006Bz-2F; Wed, 03 Aug 2011 13:46:48 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIY-00058y-Kw for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:15 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIX-0000CT-Sb for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:13 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:13 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] VT-d: always clean up dpci timers. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1311608493 -3600 # Node ID aa54b8175954bd6ffeb3bcf72e782e133896b388 # Parent 9dbbf1631193bb6df679f5eaaee192ef4ef91fd9 VT-d: always clean up dpci timers. Message-ID: <20110718163848.GD18276@whitby.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) If a VM has all its PCI devices deassigned, need_iommu(d) becomes false but it might still have DPCI EOI timers that were init_timer()d but not yet kill_timer()d. That causes xen to crash later because the linked list of inactive timers gets corrupted, e.g.: (XEN) Xen call trace: (XEN) [] set_timer+0x1c2/0x24f (XEN) [] schedule+0x129/0x5dd (XEN) [] __do_softirq+0x7e/0x89 (XEN) [] do_softirq+0x26/0x28 (XEN) [] idle_loop+0x5a/0x5c (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Assertion 'entry->next->prev == entry' failed at /local/scratch/tdeegan/xen-unstable.hg/xen/include:172 (XEN) **************************************** The following patch makes sure that the domain destruction path always clears up the DPCI state even if !needs_iommu(d). Signed-off-by: Tim Deegan --- diff -r 9dbbf1631193 -r aa54b8175954 xen/drivers/passthrough/pci.c --- a/xen/drivers/passthrough/pci.c Mon Jul 25 14:21:13 2011 +0100 +++ b/xen/drivers/passthrough/pci.c Mon Jul 25 16:41:33 2011 +0100 @@ -237,7 +237,7 @@ if ( !iommu_enabled ) return; - if ( !is_hvm_domain(d) || !need_iommu(d) ) + if ( !is_hvm_domain(d) ) return; spin_lock(&d->event_lock); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:46:56 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:46:56 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiL9-0006FF-WB; Wed, 03 Aug 2011 13:46:56 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIZ-000590-4p for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:15 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIY-0000Ci-Bc for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:14 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:13 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86-64/MMCFG: correct base address computation for regions not starting at bus 0 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1311608539 -3600 # Node ID b07b6fa766562c990b1d1e59af032feda15c2edb # Parent aa54b8175954bd6ffeb3bcf72e782e133896b388 x86-64/MMCFG: correct base address computation for regions not starting at bus 0 As per the specification, the base address reported by ACPI is the one that would be used if the region started at bus 0. Hence the start_bus_number offset needs to be added not only to the virtual address, but also the physical one when establishing the mapping, and it then needs to be subtracted when obtaining the virtual address for doing accesses. Signed-off-by: Jan Beulich --- diff -r aa54b8175954 -r b07b6fa76656 xen/arch/x86/x86_64/mmconfig_64.c --- a/xen/arch/x86/x86_64/mmconfig_64.c Mon Jul 25 16:41:33 2011 +0100 +++ b/xen/arch/x86/x86_64/mmconfig_64.c Mon Jul 25 16:42:19 2011 +0100 @@ -25,7 +25,7 @@ static struct mmcfg_virt *pci_mmcfg_virt; static int __initdata mmcfg_pci_segment_shift; -static char __iomem *get_virt(unsigned int seg, unsigned bus) +static char __iomem *get_virt(unsigned int seg, unsigned int *bus) { struct acpi_mcfg_allocation *cfg; int cfg_num; @@ -33,9 +33,11 @@ for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) { cfg = pci_mmcfg_virt[cfg_num].cfg; if (cfg->pci_segment == seg && - (cfg->start_bus_number <= bus) && - (cfg->end_bus_number >= bus)) + (cfg->start_bus_number <= *bus) && + (cfg->end_bus_number >= *bus)) { + *bus -= cfg->start_bus_number; return pci_mmcfg_virt[cfg_num].virt; + } } /* Fall back to type 0 */ @@ -46,7 +48,7 @@ { char __iomem *addr; - addr = get_virt(seg, bus); + addr = get_virt(seg, &bus); if (!addr) return NULL; return addr + ((bus << 20) | (devfn << 12)); @@ -121,8 +123,11 @@ if (virt + size < virt || virt + size > PCI_MCFG_VIRT_END) return NULL; - map_pages_to_xen(virt, cfg->address >> PAGE_SHIFT, - size >> PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE); + if (map_pages_to_xen(virt, + (cfg->address >> PAGE_SHIFT) + + (cfg->start_bus_number << (20 - PAGE_SHIFT)), + size >> PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE)) + return NULL; return (void __iomem *) virt; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:47:04 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:47:04 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiLI-0006JJ-2N; Wed, 03 Aug 2011 13:47:04 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIZ-00059F-JT for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:16 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIY-0000Cx-Re for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:14 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:14 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86-64/MMCFG: finally make Fam10 enabling work X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1311608573 -3600 # Node ID e1717d180897e6e7a04d83a41d86b35ac16912b9 # Parent b07b6fa766562c990b1d1e59af032feda15c2edb x86-64/MMCFG: finally make Fam10 enabling work Forcibly enabling the MMCFG space on AMD Fam10 CPUs cannot be expected to work since with the firmware not being aware of the address range used it cannot possibly reserve the space in E820 or ACPI resources. Hence we need to manually insert the range into the E820 table, and enable the range only when the insertion actually works without conflict. Further, the actual enabling of the space is done from identify_cpu(), which means that acpi_mmcfg_init() muts be called after that function (and hance should not be called from acpi_boot_init()). Otherwise, Dom0 would be able to use MMCFG, but Xen wouldn't. Signed-off-by: Jan Beulich --- diff -r b07b6fa76656 -r e1717d180897 xen/arch/x86/acpi/boot.c --- a/xen/arch/x86/acpi/boot.c Mon Jul 25 16:42:19 2011 +0100 +++ b/xen/arch/x86/acpi/boot.c Mon Jul 25 16:42:53 2011 +0100 @@ -832,8 +832,6 @@ acpi_dmar_init(); - acpi_mmcfg_init(); - erst_init(); return 0; diff -r b07b6fa76656 -r e1717d180897 xen/arch/x86/e820.c --- a/xen/arch/x86/e820.c Mon Jul 25 16:42:19 2011 +0100 +++ b/xen/arch/x86/e820.c Mon Jul 25 16:42:53 2011 +0100 @@ -563,6 +563,55 @@ clip_to_limit(top_of_ram, "MTRRs do not cover all of memory."); } +/* This function relies on the passed in e820->map[] being sorted. */ +int __init e820_add_range( + struct e820map *e820, uint64_t s, uint64_t e, uint32_t type) +{ + unsigned int i; + + for ( i = 0; i < e820->nr_map; ++i ) + { + uint64_t rs = e820->map[i].addr; + uint64_t re = rs + e820->map[i].size; + + if ( rs == e && e820->map[i].type == type ) + { + e820->map[i].addr = s; + return 1; + } + + if ( re == s && e820->map[i].type == type && + (i + 1 == e820->nr_map || e820->map[i + 1].addr >= e) ) + { + e820->map[i].size += e - s; + return 1; + } + + if ( rs >= e ) + break; + + if ( re > s ) + return 0; + } + + if ( e820->nr_map >= ARRAY_SIZE(e820->map) ) + { + printk(XENLOG_WARNING "E820: overflow while adding region" + " %"PRIx64"-%"PRIx64"\n", s, e); + return 0; + } + + memmove(e820->map + i + 1, e820->map + i, + (e820->nr_map - i) * sizeof(*e820->map)); + + e820->nr_map++; + e820->map[i].addr = s; + e820->map[i].size = e - s; + e820->map[i].type = type; + + return 1; +} + int __init e820_change_range_type( struct e820map *e820, uint64_t s, uint64_t e, uint32_t orig_type, uint32_t new_type) diff -r b07b6fa76656 -r e1717d180897 xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Mon Jul 25 16:42:19 2011 +0100 +++ b/xen/arch/x86/setup.c Mon Jul 25 16:42:53 2011 +0100 @@ -1248,6 +1248,8 @@ #ifdef CONFIG_X86_64 vesa_mtrr_init(); + + acpi_mmcfg_init(); #endif if ( opt_nosmp ) diff -r b07b6fa76656 -r e1717d180897 xen/arch/x86/x86_32/pci.c --- a/xen/arch/x86/x86_32/pci.c Mon Jul 25 16:42:19 2011 +0100 +++ b/xen/arch/x86/x86_32/pci.c Mon Jul 25 16:42:53 2011 +0100 @@ -60,8 +60,3 @@ { return 0; } - -void acpi_mmcfg_init(void) -{ - return; -} diff -r b07b6fa76656 -r e1717d180897 xen/arch/x86/x86_64/mmconf-fam10h.c --- a/xen/arch/x86/x86_64/mmconf-fam10h.c Mon Jul 25 16:42:19 2011 +0100 +++ b/xen/arch/x86/x86_64/mmconf-fam10h.c Mon Jul 25 16:42:53 2011 +0100 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -131,7 +132,8 @@ return; out: - fam10h_pci_mmconf_base = start; + if (e820_add_range(&e820, start, start + SIZE, E820_RESERVED)) + fam10h_pci_mmconf_base = start; } void __cpuinit fam10h_check_enable_mmcfg(void) diff -r b07b6fa76656 -r e1717d180897 xen/include/asm-x86/e820.h --- a/xen/include/asm-x86/e820.h Mon Jul 25 16:42:19 2011 +0100 +++ b/xen/include/asm-x86/e820.h Mon Jul 25 16:42:53 2011 +0100 @@ -28,6 +28,8 @@ extern int e820_change_range_type( struct e820map *e820, uint64_t s, uint64_t e, uint32_t orig_type, uint32_t new_type); +extern int e820_add_range( + struct e820map *, uint64_t s, uint64_t e, uint32_t type); extern unsigned long init_e820(const char *, struct e820entry *, int *); extern struct e820map e820; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:47:12 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:47:12 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiLQ-0006Mb-6v; Wed, 03 Aug 2011 13:47:12 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIa-00059j-8t for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:16 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIU-0000An-Hf for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:10 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: New functions mem_hole_alloc() and mem_hole_populate_ram(). X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311410627 -3600 # Node ID 815ef5cf02613b9d21e2c9837760278516a69965 # Parent 88847c424eec8c5d5df79fc5e961660fe31d83ec hvmloader: New functions mem_hole_alloc() and mem_hole_populate_ram(). These can be used by BIOS-specific handlers to set up memory regions as required by their firmware payload. Use mem_hole_alloc() to allocate properly reserved space for the shared-info-page mapping. The old location conflicts with space required for the OVMF BIOS (support for which is work in progress). Signed-off-by: Keir Fraser --- diff -r 88847c424eec -r 815ef5cf0261 tools/firmware/hvmloader/util.c --- a/tools/firmware/hvmloader/util.c Sat Jul 23 08:58:37 2011 +0100 +++ b/tools/firmware/hvmloader/util.c Sat Jul 23 09:43:47 2011 +0100 @@ -303,29 +303,14 @@ *p = '\0'; } -void *mem_alloc(uint32_t size, uint32_t align) +void mem_hole_populate_ram(xen_pfn_t mfn, uint32_t nr_mfns) { - static uint32_t reserve = RESERVED_MEMBASE - 1; static int over_allocated; struct xen_add_to_physmap xatp; struct xen_memory_reservation xmr; - xen_pfn_t mfn; - uint32_t s, e; - /* Align to at least 16 bytes. */ - if ( align < 16 ) - align = 16; - - s = (reserve + align) & ~(align - 1); - e = s + size - 1; - - BUG_ON((e < s) || (e >> PAGE_SHIFT) >= hvm_info->reserved_mem_pgstart); - - while ( (reserve >> PAGE_SHIFT) != (e >> PAGE_SHIFT) ) + for ( ; nr_mfns-- != 0; mfn++ ) { - reserve += PAGE_SIZE; - mfn = reserve >> PAGE_SHIFT; - /* Try to allocate a brand new page in the reserved area. */ if ( !over_allocated ) { @@ -356,6 +341,35 @@ if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 ) BUG(); } +} + +static uint32_t reserve = RESERVED_MEMBASE - 1; + +xen_pfn_t mem_hole_alloc(uint32_t nr_mfns) +{ + hvm_info->reserved_mem_pgstart -= nr_mfns; + BUG_ON(hvm_info->reserved_mem_pgstart <= (reserve >> PAGE_SHIFT)); + return hvm_info->reserved_mem_pgstart; +} + +void *mem_alloc(uint32_t size, uint32_t align) +{ + uint32_t s, e; + + /* Align to at least 16 bytes. */ + if ( align < 16 ) + align = 16; + + s = (reserve + align) & ~(align - 1); + e = s + size - 1; + + BUG_ON((e < s) || (e >> PAGE_SHIFT) >= hvm_info->reserved_mem_pgstart); + + while ( (reserve >> PAGE_SHIFT) != (e >> PAGE_SHIFT) ) + { + reserve += PAGE_SIZE; + mem_hole_populate_ram(reserve >> PAGE_SHIFT, 1); + } reserve = e; @@ -635,7 +649,7 @@ xatp.domid = DOMID_SELF; xatp.space = XENMAPSPACE_shared_info; xatp.idx = 0; - xatp.gpfn = 0xfffffu; + xatp.gpfn = mem_hole_alloc(1); shared_info = (struct shared_info *)(xatp.gpfn << PAGE_SHIFT); if ( hypercall_memory_op(XENMEM_add_to_physmap, &xatp) != 0 ) BUG(); diff -r 88847c424eec -r 815ef5cf0261 tools/firmware/hvmloader/util.h --- a/tools/firmware/hvmloader/util.h Sat Jul 23 08:58:37 2011 +0100 +++ b/tools/firmware/hvmloader/util.h Sat Jul 23 09:43:47 2011 +0100 @@ -3,6 +3,7 @@ #include #include +#include #include #define __STR(...) #__VA_ARGS__ @@ -164,6 +165,12 @@ int printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); int vprintf(const char *fmt, va_list ap); +/* Populate specified memory hole with RAM. */ +void mem_hole_populate_ram(xen_pfn_t mfn, uint32_t nr_mfns); + +/* Allocate a memory hole below 4GB. */ +xen_pfn_t mem_hole_alloc(uint32_t nr_mfns); + /* Allocate memory in a reserved region below 4GB. */ void *mem_alloc(uint32_t size, uint32_t align); #define virt_to_phys(v) ((unsigned long)(v)) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:47:20 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:47:20 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiLY-0006Q0-Gr; Wed, 03 Aug 2011 13:47:20 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIa-00059c-26 for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:16 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIZ-0000DC-Ar for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:15 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:14 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86-64/MMCFG: pass down firmware (ACPI) reservation status of used memory space X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1311608606 -3600 # Node ID e8d1c8f074babcb0e4511393106e80a918a38204 # Parent e1717d180897e6e7a04d83a41d86b35ac16912b9 x86-64/MMCFG: pass down firmware (ACPI) reservation status of used memory space Reserving the MMCFG address range(s) in E820 is specified to only be optional for the firmware to do. The requirement is to have them reserved in ACPI resources. Those, however, aren't directly visible to Xen as they require the ACPI interpreter to be active. Thus, if a range isn't reserved in E820, we should not completely disable use of MMCFG on the respective bus range, but rather keep it disabled until Dom0 can pass down information on the ACPI reservation status (though a new physdevop hypercall). Signed-off-by: Jan Beulich --- diff -r e1717d180897 -r e8d1c8f074ba xen/arch/x86/physdev.c --- a/xen/arch/x86/physdev.c Mon Jul 25 16:42:53 2011 +0100 +++ b/xen/arch/x86/physdev.c Mon Jul 25 16:43:26 2011 +0100 @@ -21,6 +21,10 @@ struct msi_info *); int physdev_unmap_pirq(domid_t, int pirq); +#ifdef CONFIG_X86_64 +#include "x86_64/mmconfig.h" +#endif + #ifndef COMPAT typedef long ret_t; @@ -522,6 +526,24 @@ break; } +#ifdef __x86_64__ + case PHYSDEVOP_pci_mmcfg_reserved: { + struct physdev_pci_mmcfg_reserved info; + + ret = -EPERM; + if ( !IS_PRIV(current->domain) ) + break; + + ret = -EFAULT; + if ( copy_from_guest(&info, arg, 1) ) + break; + + ret = pci_mmcfg_reserved(info.address, info.segment, + info.start_bus, info.end_bus, info.flags); + break; + } +#endif + case PHYSDEVOP_restore_msi: { struct physdev_restore_msi restore_msi; struct pci_dev *pdev; diff -r e1717d180897 -r e8d1c8f074ba xen/arch/x86/x86_64/mmconfig-shared.c --- a/xen/arch/x86/x86_64/mmconfig-shared.c Mon Jul 25 16:42:53 2011 +0100 +++ b/xen/arch/x86/x86_64/mmconfig-shared.c Mon Jul 25 16:43:26 2011 +0100 @@ -22,10 +22,10 @@ #include #include #include +#include #include "mmconfig.h" -static int __initdata known_bridge; unsigned int pci_probe = PCI_PROBE_CONF1 | PCI_PROBE_MMCONF; static void __init parse_mmcfg(char *s) @@ -316,26 +316,21 @@ return name != NULL; } -typedef int (*check_reserved_t)(u64 start, u64 end, unsigned type); - static int __init is_mmconf_reserved( - check_reserved_t is_reserved, u64 addr, u64 size, int i, - typeof(pci_mmcfg_config[0]) *cfg, int with_e820) + typeof(pci_mmcfg_config[0]) *cfg) { u64 old_size = size; int valid = 0; - while (!is_reserved(addr, addr + size - 1, E820_RESERVED)) { + while (!e820_all_mapped(addr, addr + size - 1, E820_RESERVED)) { size >>= 1; if (size < (16UL<<20)) break; } if (size >= (16UL<<20) || size == old_size) { - printk(KERN_NOTICE - "PCI: MCFG area at %lx reserved in %s\n", - addr, with_e820?"E820":"ACPI motherboard resources"); + printk(KERN_NOTICE "PCI: MCFG area at %lx reserved in E820\n", addr); valid = 1; if (old_size != size) { @@ -352,15 +347,16 @@ return valid; } -static void __init pci_mmcfg_reject_broken(void) +static bool_t __init pci_mmcfg_reject_broken(void) { typeof(pci_mmcfg_config[0]) *cfg; int i; + bool_t valid = 1; if ((pci_mmcfg_config_num == 0) || (pci_mmcfg_config == NULL) || (pci_mmcfg_config[0].address == 0)) - return; + return 0; cfg = &pci_mmcfg_config[0]; @@ -374,27 +370,25 @@ size = cfg->end_bus_number + 1 - cfg->start_bus_number; size <<= 20; printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx " - "segment %hu buses %u - %u\n", + "segment %04x buses %02x - %02x\n", i, (unsigned long)cfg->address, cfg->pci_segment, (unsigned int)cfg->start_bus_number, (unsigned int)cfg->end_bus_number); - if (!is_mmconf_reserved(e820_all_mapped, addr, size, i, cfg, 1)) - goto reject; + if (!is_mmconf_reserved(addr, size, i, cfg) || + pci_mmcfg_arch_enable(i)) { + pci_mmcfg_arch_disable(i); + valid = 0; + } } - return; - -reject: - printk(KERN_INFO "PCI: Not using MMCONFIG.\n"); - pci_mmcfg_arch_free(); - xfree(pci_mmcfg_config); - pci_mmcfg_config = NULL; - pci_mmcfg_config_num = 0; + return valid; } void __init acpi_mmcfg_init(void) { + bool_t valid = 1; + /* MMCONFIG disabled */ if ((pci_probe & PCI_PROBE_MMCONF) == 0) return; @@ -403,16 +397,17 @@ if (!(pci_probe & PCI_PROBE_MASK & ~PCI_PROBE_MMCONF)) return; - /* for late to exit */ - if (known_bridge) - return; + if (pci_mmcfg_check_hostbridge()) { + unsigned int i; - if (pci_mmcfg_check_hostbridge()) - known_bridge = 1; - - if (!known_bridge) { + pci_mmcfg_arch_init(); + for (i = 0; i < pci_mmcfg_config_num; ++i) + if (pci_mmcfg_arch_enable(i)) + valid = 0; + } else { acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg); - pci_mmcfg_reject_broken(); + pci_mmcfg_arch_init(); + valid = pci_mmcfg_reject_broken(); } if ((pci_mmcfg_config_num == 0) || @@ -420,9 +415,41 @@ (pci_mmcfg_config[0].address == 0)) return; - if (pci_mmcfg_arch_init()) { + if (valid) pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; +} + +int pci_mmcfg_reserved(uint64_t address, unsigned int segment, + unsigned int start_bus, unsigned int end_bus, + unsigned int flags) +{ + unsigned int i; + + if (flags & ~XEN_PCI_MMCFG_RESERVED) + return -EINVAL; + + for (i = 0; i < pci_mmcfg_config_num; ++i) { + const typeof(pci_mmcfg_config[0]) *cfg = &pci_mmcfg_config[i]; + + if (cfg->pci_segment == segment && + cfg->start_bus_number == start_bus && + cfg->end_bus_number == end_bus) { + if (cfg->address != address) { + printk(KERN_WARNING + "Base address presented for segment %04x bus %02x-%02x" + " (%08" PRIx64 ") does not match previously obtained" + " one (%08" PRIx64 ")\n", + segment, start_bus, end_bus, address, cfg->address); + return -EIO; + } + if (flags & XEN_PCI_MMCFG_RESERVED) + return pci_mmcfg_arch_enable(i); + pci_mmcfg_arch_disable(i); + return 0; + } } + + return -ENODEV; } /** diff -r e1717d180897 -r e8d1c8f074ba xen/arch/x86/x86_64/mmconfig.h --- a/xen/arch/x86/x86_64/mmconfig.h Mon Jul 25 16:42:53 2011 +0100 +++ b/xen/arch/x86/x86_64/mmconfig.h Mon Jul 25 16:43:26 2011 +0100 @@ -85,5 +85,9 @@ /* function prototypes */ int acpi_parse_mcfg(struct acpi_table_header *header); +int pci_mmcfg_reserved(uint64_t address, unsigned int segment, + unsigned int start_bus, unsigned int end_bus, + unsigned int flags); int pci_mmcfg_arch_init(void); -void pci_mmcfg_arch_free(void); +int pci_mmcfg_arch_enable(unsigned int); +void pci_mmcfg_arch_disable(unsigned int); diff -r e1717d180897 -r e8d1c8f074ba xen/arch/x86/x86_64/mmconfig_64.c --- a/xen/arch/x86/x86_64/mmconfig_64.c Mon Jul 25 16:42:53 2011 +0100 +++ b/xen/arch/x86/x86_64/mmconfig_64.c Mon Jul 25 16:43:26 2011 +0100 @@ -112,7 +112,8 @@ return 0; } -static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg) +static void __iomem *mcfg_ioremap(const struct acpi_mcfg_allocation *cfg, + unsigned int prot) { unsigned long virt, size; @@ -126,19 +127,55 @@ if (map_pages_to_xen(virt, (cfg->address >> PAGE_SHIFT) + (cfg->start_bus_number << (20 - PAGE_SHIFT)), - size >> PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE)) + size >> PAGE_SHIFT, prot)) return NULL; return (void __iomem *) virt; } +int pci_mmcfg_arch_enable(unsigned int idx) +{ + const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg; + + if (pci_mmcfg_virt[idx].virt) + return 0; + pci_mmcfg_virt[idx].virt = mcfg_ioremap(cfg, PAGE_HYPERVISOR_NOCACHE); + if (!pci_mmcfg_virt[idx].virt) { + printk(KERN_ERR "PCI: Cannot map MCFG aperture for segment %04x\n", + cfg->pci_segment); + return -ENOMEM; + } + printk(KERN_INFO "PCI: Using MCFG for segment %04x bus %02x-%02x\n", + cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number); + return 0; +} + +void pci_mmcfg_arch_disable(unsigned int idx) +{ + const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg; + + pci_mmcfg_virt[idx].virt = NULL; + /* + * Don't use destroy_xen_mappings() here, or make sure that at least + * the necessary L4 entries get populated (so that they get properly + * propagated to guest domains' page tables). + */ + mcfg_ioremap(cfg, 0); + printk(KERN_WARNING "PCI: Not using MCFG for segment %04x bus %02x-%02x\n", + cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number); +} + int __init pci_mmcfg_arch_init(void) { int i; + if (pci_mmcfg_virt) + return 0; + pci_mmcfg_virt = xmalloc_array(struct mmcfg_virt, pci_mmcfg_config_num); if (pci_mmcfg_virt == NULL) { printk(KERN_ERR "PCI: Can not allocate memory for mmconfig structures\n"); + pci_mmcfg_config_num = 0; return 0; } memset(pci_mmcfg_virt, 0, sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num); @@ -149,39 +186,5 @@ ++mmcfg_pci_segment_shift; } mmcfg_pci_segment_shift += 20; - for (i = 0; i < pci_mmcfg_config_num; ++i) { - pci_mmcfg_virt[i].virt = mcfg_ioremap(&pci_mmcfg_config[i]); - if (!pci_mmcfg_virt[i].virt) { - printk(KERN_ERR "PCI: Cannot map mmconfig aperture for " - "segment %d\n", - pci_mmcfg_config[i].pci_segment); - pci_mmcfg_arch_free(); - return 0; - } - } return 1; } - -void __init pci_mmcfg_arch_free(void) -{ - int i; - - if (pci_mmcfg_virt == NULL) - return; - - for (i = 0; i < pci_mmcfg_config_num; ++i) { - if (pci_mmcfg_virt[i].virt) { - unsigned long size; - const struct acpi_mcfg_allocation *cfg = pci_mmcfg_virt[i].cfg; - - size = (cfg->end_bus_number - cfg->start_bus_number + 1) << 20; - destroy_xen_mappings((unsigned long)pci_mmcfg_virt[i].virt, - (unsigned long)pci_mmcfg_virt[i].virt + size); - pci_mmcfg_virt[i].virt = NULL; - pci_mmcfg_virt[i].cfg = NULL; - } - } - - xfree(pci_mmcfg_virt); - pci_mmcfg_virt = NULL; -} diff -r e1717d180897 -r e8d1c8f074ba xen/arch/x86/x86_64/physdev.c --- a/xen/arch/x86/x86_64/physdev.c Mon Jul 25 16:42:53 2011 +0100 +++ b/xen/arch/x86/x86_64/physdev.c Mon Jul 25 16:43:26 2011 +0100 @@ -63,6 +63,10 @@ CHECK_physdev_get_free_pirq; #undef xen_physdev_get_free_pirq +#define xen_physdev_pci_mmcfg_reserved physdev_pci_mmcfg_reserved +CHECK_physdev_pci_mmcfg_reserved; +#undef xen_physdev_pci_mmcfg_reserved + #define COMPAT #undef guest_handle_okay #define guest_handle_okay compat_handle_okay diff -r e1717d180897 -r e8d1c8f074ba xen/include/public/physdev.h --- a/xen/include/public/physdev.h Mon Jul 25 16:42:53 2011 +0100 +++ b/xen/include/public/physdev.h Mon Jul 25 16:43:26 2011 +0100 @@ -255,6 +255,19 @@ typedef struct physdev_get_free_pirq physdev_get_free_pirq_t; DEFINE_XEN_GUEST_HANDLE(physdev_get_free_pirq_t); +#define XEN_PCI_MMCFG_RESERVED 0x1 + +#define PHYSDEVOP_pci_mmcfg_reserved 24 +struct physdev_pci_mmcfg_reserved { + uint64_t address; + uint16_t segment; + uint8_t start_bus; + uint8_t end_bus; + uint32_t flags; +}; +typedef struct physdev_pci_mmcfg_reserved physdev_pci_mmcfg_reserved_t; +DEFINE_XEN_GUEST_HANDLE(physdev_pci_mmcfg_reserved_t); + /* * Notify that some PIRQ-bound event channels have been unmasked. * ** This command is obsolete since interface version 0x00030202 and is ** diff -r e1717d180897 -r e8d1c8f074ba xen/include/xlat.lst --- a/xen/include/xlat.lst Mon Jul 25 16:42:53 2011 +0100 +++ b/xen/include/xlat.lst Mon Jul 25 16:43:26 2011 +0100 @@ -65,6 +65,7 @@ ? physdev_irq_status_query physdev.h ? physdev_manage_pci physdev.h ? physdev_manage_pci_ext physdev.h +? physdev_pci_mmcfg_reserved physdev.h ? physdev_unmap_pirq physdev.h ? physdev_restore_msi physdev.h ? physdev_set_iopl physdev.h _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:47:27 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:47:27 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiLf-0006Tw-Lc; Wed, 03 Aug 2011 13:47:27 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIa-00059k-IF for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:16 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIZ-0000DS-Px for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:15 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:15 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Nested VMX: always mark VVMCS as not-launched on VMCLEAR. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1311696024 -3600 # Node ID 3114b45cf7a0a2d915884bba544be451968b6d0c # Parent e8d1c8f074babcb0e4511393106e80a918a38204 Nested VMX: always mark VVMCS as not-launched on VMCLEAR. The SDM says to flush changes and clear the launch state even if this isn't the "current VMCS". KVM relies on this behaviour, so take the warning printk away as well. Signed-off-by: Tim Deegan --- diff -r e8d1c8f074ba -r 3114b45cf7a0 xen/arch/x86/hvm/vmx/vvmx.c --- a/xen/arch/x86/hvm/vmx/vvmx.c Mon Jul 25 16:43:26 2011 +0100 +++ b/xen/arch/x86/hvm/vmx/vvmx.c Tue Jul 26 17:00:24 2011 +0100 @@ -1162,6 +1162,7 @@ struct vmx_inst_decoded decode; struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v); unsigned long gpa = 0; + void *vvmcs; int rc; rc = decode_vmx_inst(regs, &decode, &gpa, 0); @@ -1171,24 +1172,24 @@ if ( gpa & 0xfff ) { vmreturn(regs, VMFAIL_INVALID); - goto out; + return X86EMUL_OKAY; + } + + if ( gpa == nvcpu->nv_vvmcxaddr ) + { + __set_vvmcs(nvcpu->nv_vvmcx, NVMX_LAUNCH_STATE, 0); + nvmx_purge_vvmcs(v); + } + else + { + /* Even if this VMCS isn't the current one, we must clear it. */ + vvmcs = hvm_map_guest_frame_rw(gpa >> PAGE_SHIFT); + if ( vvmcs ) + __set_vvmcs(vvmcs, NVMX_LAUNCH_STATE, 0); + hvm_unmap_guest_frame(vvmcs); } - if ( gpa != nvcpu->nv_vvmcxaddr && nvcpu->nv_vvmcxaddr != VMCX_EADDR ) - { - gdprintk(XENLOG_WARNING, - "vmclear gpa %lx not the same as current vmcs %"PRIpaddr"\n", - gpa, nvcpu->nv_vvmcxaddr); - vmreturn(regs, VMSUCCEED); - goto out; - } - if ( nvcpu->nv_vvmcxaddr != VMCX_EADDR ) - __set_vvmcs(nvcpu->nv_vvmcx, NVMX_LAUNCH_STATE, 0); - nvmx_purge_vvmcs(v); - vmreturn(regs, VMSUCCEED); - -out: return X86EMUL_OKAY; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:47:38 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:47:38 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiLq-0006XP-Hv; Wed, 03 Aug 2011 13:47:38 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIb-00059o-0E for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:17 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIa-0000Dh-8u for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:16 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:15 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Nested VMX: fix error paths in emulation of VMLAUNCH and VMRESUME. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1311696025 -3600 # Node ID 590aadf7c46ae979da3552332f592f9492ce6d8b # Parent 3114b45cf7a0a2d915884bba544be451968b6d0c Nested VMX: fix error paths in emulation of VMLAUNCH and VMRESUME. These instructions don't fault on bad VMCS pointers, they set bits in RFLAGS and continue execution. Signed-off-by: Tim Deegan --- diff -r 3114b45cf7a0 -r 590aadf7c46a xen/arch/x86/hvm/vmx/vvmx.c --- a/xen/arch/x86/hvm/vmx/vvmx.c Tue Jul 26 17:00:24 2011 +0100 +++ b/xen/arch/x86/hvm/vmx/vvmx.c Tue Jul 26 17:00:25 2011 +0100 @@ -1070,11 +1070,17 @@ int launched; struct vcpu *v = current; + if ( vcpu_nestedhvm(v).nv_vvmcxaddr == VMCX_EADDR ) + { + vmreturn (regs, VMFAIL_INVALID); + return X86EMUL_OKAY; + } + launched = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, NVMX_LAUNCH_STATE); if ( !launched ) { vmreturn (regs, VMFAIL_VALID); - return X86EMUL_EXCEPTION; + return X86EMUL_OKAY; } return nvmx_vmresume(v,regs); } @@ -1085,11 +1091,17 @@ int rc; struct vcpu *v = current; + if ( vcpu_nestedhvm(v).nv_vvmcxaddr == VMCX_EADDR ) + { + vmreturn (regs, VMFAIL_INVALID); + return X86EMUL_OKAY; + } + launched = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, NVMX_LAUNCH_STATE); if ( launched ) { vmreturn (regs, VMFAIL_VALID); - rc = X86EMUL_EXCEPTION; + return X86EMUL_OKAY; } else { rc = nvmx_vmresume(v,regs); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:47:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:47:50 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiM2-0006bM-F0; Wed, 03 Aug 2011 13:47:50 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIb-0005AA-Gi for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:17 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIa-0000Dw-Or for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:16 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:16 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] xen: Infrastructure to allow irqs to share vector maps X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User George Dunlap # Date 1311701818 -3600 # Node ID ef9ed3d2aa870a37ed5e611be9c524d526a2d604 # Parent 590aadf7c46ae979da3552332f592f9492ce6d8b xen: Infrastructure to allow irqs to share vector maps Laying the groundwork for per-device vector maps. This generic code allows any irq to point to a vector map; all irqs sharing the same vector map will avoid sharing vectors. Signed-off-by: George Dunlap --- diff -r 590aadf7c46a -r ef9ed3d2aa87 xen/arch/x86/io_apic.c --- a/xen/arch/x86/io_apic.c Tue Jul 26 17:00:25 2011 +0100 +++ b/xen/arch/x86/io_apic.c Tue Jul 26 18:36:58 2011 +0100 @@ -449,6 +449,11 @@ irq, vector, smp_processor_id()); __get_cpu_var(vector_irq)[vector] = -1; + if ( cfg->used_vectors ) + { + ASSERT(test_bit(vector, cfg->used_vectors)); + clear_bit(vector, cfg->used_vectors); + } cfg->move_cleanup_count--; unlock: spin_unlock(&desc->lock); diff -r 590aadf7c46a -r ef9ed3d2aa87 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Tue Jul 26 17:00:25 2011 +0100 +++ b/xen/arch/x86/irq.c Tue Jul 26 18:36:58 2011 +0100 @@ -108,6 +108,8 @@ per_cpu(vector_irq, cpu)[vector] = irq; cfg->vector = vector; cfg->cpu_mask = online_mask; + if ( cfg->used_vectors ) + set_bit(vector, cfg->used_vectors); irq_status[irq] = IRQ_USED; if (IO_APIC_IRQ(irq)) irq_vector[irq] = vector; @@ -172,6 +174,7 @@ desc->depth = 1; desc->msi_desc = NULL; desc->handler = &no_irq_type; + desc->chip_data->used_vectors=NULL; cpus_setall(desc->affinity); spin_unlock_irqrestore(&desc->lock, flags); @@ -200,6 +203,9 @@ for_each_cpu_mask(cpu, tmp_mask) per_cpu(vector_irq, cpu)[vector] = -1; + if ( cfg->used_vectors ) + clear_bit(vector, cfg->used_vectors); + cfg->vector = IRQ_VECTOR_UNASSIGNED; cpus_clear(cfg->cpu_mask); init_one_irq_status(irq); @@ -277,6 +283,7 @@ cfg->vector = IRQ_VECTOR_UNASSIGNED; cpus_clear(cfg->cpu_mask); cpus_clear(cfg->old_cpu_mask); + cfg->used_vectors = NULL; } int __init init_irq_data(void) @@ -402,6 +409,10 @@ if (test_bit(vector, used_vectors)) goto next; + if (cfg->used_vectors + && test_bit(vector, cfg->used_vectors) ) + goto next; + for_each_cpu_mask(new_cpu, tmp_mask) if (per_cpu(vector_irq, new_cpu)[vector] != -1) goto next; @@ -417,6 +428,11 @@ per_cpu(vector_irq, new_cpu)[vector] = irq; cfg->vector = vector; cpus_copy(cfg->cpu_mask, tmp_mask); + if ( cfg->used_vectors ) + { + ASSERT(!test_bit(vector, cfg->used_vectors)); + set_bit(vector, cfg->used_vectors); + } irq_status[irq] = IRQ_USED; if (IO_APIC_IRQ(irq)) diff -r 590aadf7c46a -r ef9ed3d2aa87 xen/include/asm-x86/irq.h --- a/xen/include/asm-x86/irq.h Tue Jul 26 17:00:25 2011 +0100 +++ b/xen/include/asm-x86/irq.h Tue Jul 26 18:36:58 2011 +0100 @@ -24,11 +24,16 @@ #define irq_to_desc(irq) (&irq_desc[irq]) #define irq_cfg(irq) (&irq_cfg[irq]) +typedef struct { + DECLARE_BITMAP(_bits,NR_VECTORS); +} vmask_t; + struct irq_cfg { int vector; cpumask_t cpu_mask; cpumask_t old_cpu_mask; unsigned move_cleanup_count; + vmask_t *used_vectors; u8 move_in_progress : 1; }; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:47:56 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:47:56 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiM8-0006eH-Ea; Wed, 03 Aug 2011 13:47:56 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIc-0005AU-0N for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:18 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIb-0000EB-8G for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:17 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:16 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] xen: Option to allow per-device vector maps for MSI IRQs X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User George Dunlap # Date 1311701836 -3600 # Node ID 2e0cf9428554da666616982cd0074024ff85b221 # Parent ef9ed3d2aa870a37ed5e611be9c524d526a2d604 xen: Option to allow per-device vector maps for MSI IRQs Add a vector-map to pci_dev, and add an option to point MSI-related IRQs to the vector-map of the device. This prevents irqs from the same device from being assigned the same vector on different pcpus. This is required for systems using an AMD IOMMU, since the intremap tables on AMD only look at vector, and not destination ID. Signed-off-by: George Dunlap --- diff -r ef9ed3d2aa87 -r 2e0cf9428554 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Tue Jul 26 18:36:58 2011 +0100 +++ b/xen/arch/x86/irq.c Tue Jul 26 18:37:16 2011 +0100 @@ -32,6 +32,9 @@ unsigned int __read_mostly nr_irqs; integer_param("nr_irqs", nr_irqs); +bool_t __read_mostly opt_irq_perdev_vector_map = 0; +boolean_param("irq-perdev-vector-map", opt_irq_perdev_vector_map); + u8 __read_mostly *irq_vector; struct irq_desc __read_mostly *irq_desc = NULL; @@ -1654,6 +1657,9 @@ dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n", d->domain_id, irq); desc->handler = &pci_msi_type; + if ( opt_irq_perdev_vector_map + && !desc->chip_data->used_vectors ) + desc->chip_data->used_vectors = &pdev->info.used_vectors; set_domain_irq_pirq(d, irq, info); setup_msi_irq(pdev, msi_desc, irq); spin_unlock_irqrestore(&desc->lock, flags); diff -r ef9ed3d2aa87 -r 2e0cf9428554 xen/include/xen/pci.h --- a/xen/include/xen/pci.h Tue Jul 26 18:36:58 2011 +0100 +++ b/xen/include/xen/pci.h Tue Jul 26 18:37:16 2011 +0100 @@ -11,6 +11,7 @@ #include #include #include +#include /* * The PCI interface treats multi-function devices as independent @@ -38,6 +39,7 @@ u8 bus; u8 devfn; } physfn; + vmask_t used_vectors; }; struct pci_dev { _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 03 13:48:04 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 13:48:04 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiMG-0006id-DP; Wed, 03 Aug 2011 13:48:04 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QoiIc-0005Ac-Ft for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 13:44:18 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QoiIb-0000EQ-Nx for xen-changelog@lists.xensource.com; Wed, 03 Aug 2011 21:44:17 +0100 Message-Id: Date: Wed, 03 Aug 2011 21:44:17 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] xen: AMD IOMMU: Automatically enable per-device vector maps X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User George Dunlap # Date 1311701852 -3600 # Node ID fa4e2ca9ecffbc432b451f495ad0a403644a6be8 # Parent 2e0cf9428554da666616982cd0074024ff85b221 xen: AMD IOMMU: Automatically enable per-device vector maps Automatically enable per-device vector maps when using IOMMU, unless disabled specifically by an IOMMU parameter. Signed-off-by: George Dunlap --- diff -r 2e0cf9428554 -r fa4e2ca9ecff xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Tue Jul 26 18:37:16 2011 +0100 +++ b/xen/arch/x86/irq.c Tue Jul 26 18:37:32 2011 +0100 @@ -32,6 +32,7 @@ unsigned int __read_mostly nr_irqs; integer_param("nr_irqs", nr_irqs); +/* This default may be changed by the AMD IOMMU code */ bool_t __read_mostly opt_irq_perdev_vector_map = 0; boolean_param("irq-perdev-vector-map", opt_irq_perdev_vector_map); diff -r 2e0cf9428554 -r fa4e2ca9ecff xen/drivers/passthrough/amd/pci_amd_iommu.c --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Jul 26 18:37:16 2011 +0100 +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Jul 26 18:37:32 2011 +0100 @@ -25,6 +25,9 @@ #include #include +extern bool_t __read_mostly opt_irq_perdev_vector_map; +extern bool_t __read_mostly iommu_amd_perdev_vector_map; + struct amd_iommu *find_iommu_for_device(int bdf) { BUG_ON ( bdf >= ivrs_bdf_entries ); @@ -148,6 +151,18 @@ return -ENODEV; } + /* Enable use of per-device vector map unless otherwise + * specified */ + if ( iommu_amd_perdev_vector_map ) + { + printk("AMD-Vi: Enabling per-device vector maps\n"); + opt_irq_perdev_vector_map=1; + } + else + { + printk("AMD-Vi: WARNING - not enabling per-device vector maps\n"); + } + return scan_pci_devices(); } diff -r 2e0cf9428554 -r fa4e2ca9ecff xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Tue Jul 26 18:37:16 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Tue Jul 26 18:37:32 2011 +0100 @@ -49,6 +49,7 @@ bool_t __read_mostly iommu_intremap = 1; bool_t __read_mostly iommu_hap_pt_share; bool_t __read_mostly iommu_debug; +bool_t __read_mostly iommu_amd_perdev_vector_map = 1; static void __init parse_iommu_param(char *s) { @@ -81,6 +82,8 @@ iommu_dom0_strict = 1; else if ( !strcmp(s, "sharept") ) iommu_hap_pt_share = 1; + else if ( !strcmp(s, "no-perdev-vector-map") ) + iommu_amd_perdev_vector_map = 0; s = ss + 1; } while ( ss ); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From shiraedna@brueggen.com Wed Aug 03 20:35:38 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 03 Aug 2011 20:35:38 -0700 Received: from [175.201.239.113] (helo=e7k0uurpb) by lists.xensource.com with esmtp (Exim 4.43) id 1Qooif-000719-RO; Wed, 03 Aug 2011 20:35:38 -0700 To: Subject: When you purchase Replica Watches, Fake Watch, you are automatically assured of the best in quality as well as our utmost commitment to service excellence. Date: Wed, 03 Aug 2011 21:31:40 -0700 Message-ID: <72n96g56s17-11630405-375v5q88@e7k0uurpb> From: "Melonie Karoline" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_004_0FF5_F3F94981.45BF2A7F" ------=_NextPart_004_0FF5_F3F94981.45BF2A7F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Best Replica Watches at $130 each When you purchase Replica Watches, Fake Watch, you are automatically assured of the best in quality as well as our utmost commitment to service excellence. Fake Watches Free Shipping - Buy Now! http://watchsalesales.ru ------=_NextPart_004_0FF5_F3F94981.45BF2A7F Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Best Replica Watches at $130 each

When you purchase Replica Watches, Fake Watch, you are automatically assured of the best in quality as well as our utmost commitment to service excellence.

Fake Watches Free Shipping - Buy Now!
------=_NextPart_004_0FF5_F3F94981.45BF2A7F-- From xen-changelog-bounces@lists.xensource.com Thu Aug 04 05:11:13 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 04 Aug 2011 05:11:13 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qowld-0001it-2N; Thu, 04 Aug 2011 05:11:13 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qowla-0001iE-00 for xen-changelog@lists.xensource.com; Thu, 04 Aug 2011 05:11:10 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QowlY-0000XE-Pl for xen-changelog@lists.xensource.com; Thu, 04 Aug 2011 13:11:08 +0100 Message-Id: Date: Thu, 04 Aug 2011 13:11:08 +0100 From: Xen patchbot-4.0-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.0-testing] x86: Replace missing return stmt accidentally removed by 21513:649372e3d46a X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311804751 -3600 # Node ID f09ab04f614e108770a3c44084195d7522fb6997 # Parent 2e78e0ce1f3125f0e79cc00ed8f54fe2ad2d0a59 x86: Replace missing return stmt accidentally removed by 21513:649372e3d46a Signed-off-by: Keir Fraser --- diff -r 2e78e0ce1f31 -r f09ab04f614e xen/arch/x86/smpboot.c --- a/xen/arch/x86/smpboot.c Wed Jul 20 15:30:55 2011 +0100 +++ b/xen/arch/x86/smpboot.c Wed Jul 27 23:12:31 2011 +0100 @@ -1480,6 +1480,7 @@ if ( (acpi_id >= MAX_MADT_ENTRIES) || (apic_id >= MAX_APICS) || (pxm >= 256) ) + return -EINVAL; /* Detect if the cpu has been added before */ if ( x86_acpiid_to_apicid[acpi_id] != 0xff) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 04 21:55:14 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 04 Aug 2011 21:55:14 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QpCRF-0008PB-Ut; Thu, 04 Aug 2011 21:55:13 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QpCRD-0008OY-FK for xen-changelog@lists.xensource.com; Thu, 04 Aug 2011 21:55:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QpCRC-0005kj-Nr for xen-changelog@lists.xensource.com; Fri, 05 Aug 2011 05:55:10 +0100 Message-Id: Date: Fri, 05 Aug 2011 05:55:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: Enable SCI in QEMU has it disabled. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1311864054 -3600 # Node ID 0f36c2eec2e1576b4db6538b5f22d625587c1a15 # Parent ba78ea7784c9eaed396cfe6c04fb8e62c9dd8407 hvmloader: Enable SCI in QEMU has it disabled. When booting a Windows guest, the OS report an issue with the ACPI (in a BSOD). The exact issue is "SCI_EN never becomes set in PM1 Control Register." (quoted from WinDbg help). So this patch enables the flags SCI_EN if it is not yet enabled. Reported-by: Tobias Geiger Signed-off-by: Anthony PERARD Signed-off-by: Keir Fraser --- diff -r ba78ea7784c9 -r 0f36c2eec2e1 tools/firmware/hvmloader/acpi/acpi2_0.h --- a/tools/firmware/hvmloader/acpi/acpi2_0.h Thu Jul 28 13:45:09 2011 +0100 +++ b/tools/firmware/hvmloader/acpi/acpi2_0.h Thu Jul 28 15:40:54 2011 +0100 @@ -20,6 +20,7 @@ #include #include +#include #define ASCII32(a,b,c,d) \ (((a) << 0) | ((b) << 8) | ((c) << 16) | ((d) << 24)) @@ -252,6 +253,9 @@ #define ACPI_CPU_SW_SLP (1 << 13) #define ACPI_USE_PLATFORM_CLOCK (1 << 15) +/* PM1 Control Register Bits */ +#define ACPI_PM1C_SCI_EN (1 << 0) + /* * Firmware ACPI Control Structure (FACS). */ diff -r ba78ea7784c9 -r 0f36c2eec2e1 tools/firmware/hvmloader/acpi/static_tables.c --- a/tools/firmware/hvmloader/acpi/static_tables.c Thu Jul 28 13:45:09 2011 +0100 +++ b/tools/firmware/hvmloader/acpi/static_tables.c Thu Jul 28 15:40:54 2011 +0100 @@ -18,7 +18,6 @@ #include "acpi2_0.h" #include "../config.h" -#include /* * Firmware ACPI Control Structure (FACS). diff -r ba78ea7784c9 -r 0f36c2eec2e1 tools/firmware/hvmloader/hvmloader.c --- a/tools/firmware/hvmloader/hvmloader.c Thu Jul 28 13:45:09 2011 +0100 +++ b/tools/firmware/hvmloader/hvmloader.c Thu Jul 28 15:40:54 2011 +0100 @@ -26,6 +26,7 @@ #include "pci_regs.h" #include "option_rom.h" #include "apic_regs.h" +#include "acpi/acpi2_0.h" #include #include @@ -379,6 +380,25 @@ return NULL; } +static void acpi_enable_sci(void) +{ + uint8_t pm1a_cnt_val; + +#define PIIX4_SMI_CMD_IOPORT 0xb2 +#define PIIX4_ACPI_ENABLE 0xf1 + + /* + * PIIX4 emulation in QEMU has SCI_EN=0 by default. We have no legacy + * SMM implementation, so give ACPI control to the OSPM immediately. + */ + pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1); + if ( !(pm1a_cnt_val & ACPI_PM1C_SCI_EN) ) + outb(PIIX4_SMI_CMD_IOPORT, PIIX4_ACPI_ENABLE); + + pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1); + BUG_ON(!(pm1a_cnt_val & ACPI_PM1C_SCI_EN)); +} + int main(void) { const struct bios_config *bios; @@ -481,6 +501,8 @@ bios->acpi_build_tables(); } + acpi_enable_sci(); + hypercall_hvm_op(HVMOP_set_param, &p); } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 04 21:55:20 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 04 Aug 2011 21:55:20 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QpCRM-0008S2-Hu; Thu, 04 Aug 2011 21:55:20 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QpCRD-0008OX-DM for xen-changelog@lists.xensource.com; Thu, 04 Aug 2011 21:55:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QpCRC-0005kU-76 for xen-changelog@lists.xensource.com; Fri, 05 Aug 2011 05:55:10 +0100 Message-Id: Date: Fri, 05 Aug 2011 05:55:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86/mm: Handle 1GiB superpages in the pagetable walker. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1311857109 -3600 # Node ID ba78ea7784c9eaed396cfe6c04fb8e62c9dd8407 # Parent fa4e2ca9ecffbc432b451f495ad0a403644a6be8 x86/mm: Handle 1GiB superpages in the pagetable walker. This allows HAP guests to use 1GiB superpages. Shadow and PV guests still can't use them without more support in shadow/* and mm.c. Signed-off-by: Christoph Egger Signed-off-by: Tim Deegan --- diff -r fa4e2ca9ecff -r ba78ea7784c9 xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Tue Jul 26 18:37:32 2011 +0100 +++ b/xen/arch/x86/hvm/hvm.c Thu Jul 28 13:45:09 2011 +0100 @@ -2385,6 +2385,7 @@ unsigned int *ecx, unsigned int *edx) { struct vcpu *v = current; + struct domain *d = v->domain; unsigned int count = *ecx; if ( cpuid_viridian_leaves(input, eax, ebx, ecx, edx) ) @@ -2393,7 +2394,7 @@ if ( cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx) ) return; - domain_cpuid(v->domain, input, *ecx, eax, ebx, ecx, edx); + domain_cpuid(d, input, *ecx, eax, ebx, ecx, edx); switch ( input ) { @@ -2429,7 +2430,7 @@ { if ( !(v->arch.xcr0 & (1ULL << sub_leaf)) ) continue; - domain_cpuid(v->domain, input, sub_leaf, &_eax, &_ebx, &_ecx, + domain_cpuid(d, input, sub_leaf, &_eax, &_ebx, &_ecx, &_edx); if ( (_eax + _ebx) > *ebx ) *ebx = _eax + _ebx; @@ -2440,9 +2441,12 @@ case 0x80000001: /* We expose RDTSCP feature to guest only when tsc_mode == TSC_MODE_DEFAULT and host_tsc_is_safe() returns 1 */ - if ( v->domain->arch.tsc_mode != TSC_MODE_DEFAULT || + if ( d->arch.tsc_mode != TSC_MODE_DEFAULT || !host_tsc_is_safe() ) *edx &= ~cpufeat_mask(X86_FEATURE_RDTSCP); + /* Hide 1GB-superpage feature if we can't emulate it. */ + if (!hvm_pse1gb_supported(d)) + *edx &= ~cpufeat_mask(X86_FEATURE_PAGE1GB); break; } } diff -r fa4e2ca9ecff -r ba78ea7784c9 xen/arch/x86/mm/guest_walk.c --- a/xen/arch/x86/mm/guest_walk.c Tue Jul 26 18:37:32 2011 +0100 +++ b/xen/arch/x86/mm/guest_walk.c Thu Jul 28 13:45:09 2011 +0100 @@ -134,7 +134,8 @@ guest_l4e_t *l4p; #endif uint32_t gflags, mflags, iflags, rc = 0; - int pse, smep; + int smep; + bool_t pse1G = 0, pse2M = 0; perfc_incr(guest_walk); memset(gw, 0, sizeof(*gw)); @@ -181,6 +182,37 @@ rc |= ((gflags & mflags) ^ mflags); if ( rc & _PAGE_PRESENT ) goto out; + + pse1G = (gflags & _PAGE_PSE) && guest_supports_1G_superpages(v); + + if ( pse1G ) + { + /* Generate a fake l1 table entry so callers don't all + * have to understand superpages. */ + gfn_t start = guest_l3e_get_gfn(gw->l3e); + /* Grant full access in the l1e, since all the guest entry's + * access controls are enforced in the l3e. */ + int flags = (_PAGE_PRESENT|_PAGE_USER|_PAGE_RW| + _PAGE_ACCESSED|_PAGE_DIRTY); + /* Import cache-control bits. Note that _PAGE_PAT is actually + * _PAGE_PSE, and it is always set. We will clear it in case + * _PAGE_PSE_PAT (bit 12, i.e. first bit of gfn) is clear. */ + flags |= (guest_l3e_get_flags(gw->l3e) + & (_PAGE_PAT|_PAGE_PWT|_PAGE_PCD)); + if ( !(gfn_x(start) & 1) ) + /* _PAGE_PSE_PAT not set: remove _PAGE_PAT from flags. */ + flags &= ~_PAGE_PAT; + + if ( gfn_x(start) & GUEST_L3_GFN_MASK & ~0x1 ) + rc |= _PAGE_INVALID_BITS; + + /* Increment the pfn by the right number of 4k pages. */ + start = _gfn((gfn_x(start) & ~GUEST_L3_GFN_MASK) + + ((va >> PAGE_SHIFT) & GUEST_L3_GFN_MASK)); + gw->l1e = guest_l1e_from_gfn(start, flags); + gw->l2mfn = gw->l1mfn = _mfn(INVALID_MFN); + goto set_ad; + } #else /* PAE only... */ @@ -219,10 +251,9 @@ if ( rc & _PAGE_PRESENT ) goto out; - pse = (guest_supports_superpages(v) && - (guest_l2e_get_flags(gw->l2e) & _PAGE_PSE)); + pse2M = (gflags & _PAGE_PSE) && guest_supports_superpages(v); - if ( pse ) + if ( pse2M ) { /* Special case: this guest VA is in a PSE superpage, so there's * no guest l1e. We make one up so that the propagation code @@ -242,9 +273,7 @@ /* _PAGE_PSE_PAT not set: remove _PAGE_PAT from flags. */ flags &= ~_PAGE_PAT; -#define GUEST_L2_GFN_ALIGN (1 << (GUEST_L2_PAGETABLE_SHIFT - \ - GUEST_L1_PAGETABLE_SHIFT)) - if ( gfn_x(start) & (GUEST_L2_GFN_ALIGN - 1) & ~0x1 ) + if ( gfn_x(start) & GUEST_L2_GFN_MASK & ~0x1 ) { #if GUEST_PAGING_LEVELS == 2 /* @@ -262,7 +291,7 @@ /* Increment the pfn by the right number of 4k pages. * Mask out PAT and invalid bits. */ - start = _gfn((gfn_x(start) & ~(GUEST_L2_GFN_ALIGN - 1)) + + start = _gfn((gfn_x(start) & ~GUEST_L2_GFN_MASK) + guest_l1_table_offset(va)); gw->l1e = guest_l1e_from_gfn(start, flags); gw->l1mfn = _mfn(INVALID_MFN); @@ -282,6 +311,9 @@ rc |= ((gflags & mflags) ^ mflags); } +#if GUEST_PAGING_LEVELS >= 4 /* 64-bit only... */ +set_ad: +#endif /* Now re-invert the user-mode requirement for SMEP. */ if ( smep ) rc ^= _PAGE_USER; @@ -295,17 +327,21 @@ #if GUEST_PAGING_LEVELS == 4 /* 64-bit only... */ if ( set_ad_bits(l4p + guest_l4_table_offset(va), &gw->l4e, 0) ) paging_mark_dirty(d, mfn_x(gw->l4mfn)); - if ( set_ad_bits(l3p + guest_l3_table_offset(va), &gw->l3e, 0) ) + if ( set_ad_bits(l3p + guest_l3_table_offset(va), &gw->l3e, + (pse1G && (pfec & PFEC_write_access))) ) paging_mark_dirty(d, mfn_x(gw->l3mfn)); #endif - if ( set_ad_bits(l2p + guest_l2_table_offset(va), &gw->l2e, - (pse && (pfec & PFEC_write_access))) ) - paging_mark_dirty(d, mfn_x(gw->l2mfn)); - if ( !pse ) + if ( !pse1G ) { - if ( set_ad_bits(l1p + guest_l1_table_offset(va), &gw->l1e, - (pfec & PFEC_write_access)) ) - paging_mark_dirty(d, mfn_x(gw->l1mfn)); + if ( set_ad_bits(l2p + guest_l2_table_offset(va), &gw->l2e, + (pse2M && (pfec & PFEC_write_access))) ) + paging_mark_dirty(d, mfn_x(gw->l2mfn)); + if ( !pse2M ) + { + if ( set_ad_bits(l1p + guest_l1_table_offset(va), &gw->l1e, + (pfec & PFEC_write_access)) ) + paging_mark_dirty(d, mfn_x(gw->l1mfn)); + } } } diff -r fa4e2ca9ecff -r ba78ea7784c9 xen/include/asm-x86/guest_pt.h --- a/xen/include/asm-x86/guest_pt.h Tue Jul 26 18:37:32 2011 +0100 +++ b/xen/include/asm-x86/guest_pt.h Thu Jul 28 13:45:09 2011 +0100 @@ -177,6 +177,11 @@ #endif /* GUEST_PAGING_LEVELS != 2 */ +/* Mask of the GFNs covered by an L2 or L3 superpage */ +#define GUEST_L2_GFN_MASK (GUEST_L1_PAGETABLE_ENTRIES - 1) +#define GUEST_L3_GFN_MASK \ + ((GUEST_L2_PAGETABLE_ENTRIES * GUEST_L1_PAGETABLE_ENTRIES) - 1) + /* Which pagetable features are supported on this vcpu? */ @@ -194,6 +199,12 @@ } static inline int +guest_supports_1G_superpages(struct vcpu *v) +{ + return (GUEST_PAGING_LEVELS >= 4 && hvm_pse1gb_supported(v->domain)); +} + +static inline int guest_supports_nx(struct vcpu *v) { if ( GUEST_PAGING_LEVELS == 2 || !cpu_has_nx ) diff -r fa4e2ca9ecff -r ba78ea7784c9 xen/include/asm-x86/hvm/hvm.h --- a/xen/include/asm-x86/hvm/hvm.h Tue Jul 26 18:37:32 2011 +0100 +++ b/xen/include/asm-x86/hvm/hvm.h Thu Jul 28 13:45:09 2011 +0100 @@ -219,11 +219,16 @@ #define hvm_nx_enabled(v) \ (!!((v)->arch.hvm_vcpu.guest_efer & EFER_NX)) +/* Can we use superpages in the HAP p2m table? */ #define hvm_hap_has_1gb(d) \ (hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB) #define hvm_hap_has_2mb(d) \ (hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB) +/* Can the guest use 1GB superpages in its own pagetables? */ +#define hvm_pse1gb_supported(d) \ + (cpu_has_page1gb && paging_mode_hap(d)) + #ifdef __x86_64__ #define hvm_long_mode_enabled(v) \ ((v)->arch.hvm_vcpu.guest_efer & EFER_LMA) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From kandymandie@about-cis.com Fri Aug 05 04:23:16 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 05 Aug 2011 04:23:16 -0700 Received: from [195.182.194.187] (helo=7yk9it6i.ma) by lists.xensource.com with smtp (Exim 4.43) id 1QpIUk-0003g7-J3; Fri, 05 Aug 2011 04:23:15 -0700 Message-ID: <201108051819.DA07FCDE278414FDE4EBE@2b5125j264> To: From: "Augustina Wanita" Date: Fri, 05 Aug 2011 11:17:28 -0100 MIME-Version: 1.0 Subject: Gain Up To 4 Inches In Length And Up To 25% Girth Increase. Content-Type: multipart/alternative; boundary="----=_NextPart_003_0478_46693B9B.A49A1A7F" ------=_NextPart_003_0478_46693B9B.A49A1A7F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Enlarge you Penis Naturally Gain Up To 4 Inches In Length And Up To 25% Girth Increase. http://peniscareswift.ru ------=_NextPart_003_0478_46693B9B.A49A1A7F Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Enlarge you Penis Naturally Gain Up To 4 Inches In Length And Up To 25% Girth Increase.Click here for your 4-inches
------=_NextPart_003_0478_46693B9B.A49A1A7F-- From ardithozell@tasmail.com Tue Aug 09 02:44:58 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 09 Aug 2011 02:44:58 -0700 Received: from [59.4.95.51] (helo=1eqfqu8q16w6w.9l0kq18qst7) by lists.xensource.com with esmtp (Exim 4.43) id 1Qqiro-0002Oi-CY; Tue, 09 Aug 2011 02:44:58 -0700 Message-ID: <64i80c12w70-28825150-008o1k27@htdgeivrsj> MIME-Version: 1.0 To: Date: Tue, 09 Aug 2011 06:40:45 -0400 Subject: Buy VIAGRA Now from Online Pharmacy. Special offer: $1.02 per pill! + Free Viagra Pills With Every Order. From: "Maricruz Onita" Content-Type: multipart/alternative; boundary="----=_NextPart_001_0BDE_CDEB10A0.0C0DC8DF" ------=_NextPart_001_0BDE_CDEB10A0.0C0DC8DF Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit SPECIAL OFFER : VIAGRA on SALE at $1.02!!! Buy VIAGRA Now from Online Pharmacy. Special offer: $1.02 per pill! + Free Viagra Pills With Every Order. Lowest Prices and Satisfaction Guaranteed! http://ommatabletspharmacy.ru ------=_NextPart_001_0BDE_CDEB10A0.0C0DC8DF Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit
Buy VIAGRA Now From $0.99 & Get 12 bonus pills FREE!

Buy VIAGRA online. Best online pharmacies to buy Viagra.

Order Viagra online with huge discount
Don't miss these prices!
------=_NextPart_001_0BDE_CDEB10A0.0C0DC8DF-- From xen-changelog-bounces@lists.xensource.com Tue Aug 09 14:22:23 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 09 Aug 2011 14:22:23 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qqtkl-0007p8-9g; Tue, 09 Aug 2011 14:22:23 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qqtka-0007o4-VJ for xen-changelog@lists.xensource.com; Tue, 09 Aug 2011 14:22:14 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QqtkY-0003L7-MY for xen-changelog@lists.xensource.com; Tue, 09 Aug 2011 22:22:10 +0100 Message-Id: Date: Tue, 09 Aug 2011 22:22:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Revert 23757:f5176c177b99 "xenstored: allow guests to reintroduce themselves" X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Ian Jackson # Date 1312908496 -3600 # Node ID aca07ff1f0a59cc7ebb5ef76875229b7e99ba3ff # Parent ea18090ab6e3cb3c69d232ec0865589688db3f81 Revert 23757:f5176c177b99 "xenstored: allow guests to reintroduce themselves" This patch seems to have been applied by mistake, despite adverse comments on the list and a lack of an appropriate ack. Committed-by: Ian Jackson --- diff -r ea18090ab6e3 -r aca07ff1f0a5 tools/xenstore/xenstored_domain.c --- a/tools/xenstore/xenstored_domain.c Tue Aug 09 11:33:40 2011 +0100 +++ b/tools/xenstore/xenstored_domain.c Tue Aug 09 17:48:16 2011 +0100 @@ -315,7 +315,7 @@ { struct domain *domain; char *vec[3]; - unsigned int domid, target; + unsigned int domid; unsigned long mfn; evtchn_port_t port; int rc; @@ -326,7 +326,7 @@ return; } - if (!conn->can_write) { + if (conn->id != 0 || !conn->can_write) { send_error(conn, EACCES); return; } @@ -340,26 +340,19 @@ send_error(conn, EINVAL); return; } - /* Allow guest to reset all watches */ - if (domid != DOMID_SELF && conn->id != 0) { - send_error(conn, EACCES); - return; - } - target = domid == DOMID_SELF ? conn->id : domid; - - domain = find_domain_by_domid(target); + domain = find_domain_by_domid(domid); if (domain == NULL) { interface = xc_map_foreign_range( - *xc_handle, target, + *xc_handle, domid, getpagesize(), PROT_READ|PROT_WRITE, mfn); if (!interface) { send_error(conn, errno); return; } /* Hang domain off "in" until we're finished. */ - domain = new_domain(in, target, port); + domain = new_domain(in, domid, port); if (!domain) { munmap(interface, getpagesize()); send_error(conn, errno); @@ -372,11 +365,11 @@ talloc_steal(domain->conn, domain); fire_watches(NULL, "@introduceDomain", false); - } else if ((domain->mfn == mfn) && ((domain->conn != conn) || domid == DOMID_SELF)) { + } else if ((domain->mfn == mfn) && (domain->conn != conn)) { /* Use XS_INTRODUCE for recreating the xenbus event-channel. */ if (domain->port) xc_evtchn_unbind(xce_handle, domain->port); - rc = xc_evtchn_bind_interdomain(xce_handle, target, port); + rc = xc_evtchn_bind_interdomain(xce_handle, domid, port); domain->port = (rc == -1) ? 0 : rc; domain->remote_port = port; } else { _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 09 14:22:43 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 09 Aug 2011 14:22:43 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qqtl5-0007sV-74; Tue, 09 Aug 2011 14:22:43 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qqtkb-0007o6-0Z for xen-changelog@lists.xensource.com; Tue, 09 Aug 2011 14:22:14 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QqtkX-0003Kf-Mi for xen-changelog@lists.xensource.com; Tue, 09 Aug 2011 22:22:09 +0100 Message-Id: Date: Tue, 09 Aug 2011 22:22:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] xenstored: allow guests to reintroduce themselves X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Olaf Hering # Date 1312876420 -3600 # Node ID f5176c177b9940b7be756ddc61563bc5878e696d # Parent 0f36c2eec2e1576b4db6538b5f22d625587c1a15 xenstored: allow guests to reintroduce themselves During kexec all old watches have to be removed, otherwise the new kernel will receive unexpected events. Allow a guest to introduce itself and cleanup all of its watches. Signed-off-by: Olaf Hering --- diff -r 0f36c2eec2e1 -r f5176c177b99 tools/xenstore/xenstored_domain.c --- a/tools/xenstore/xenstored_domain.c Thu Jul 28 15:40:54 2011 +0100 +++ b/tools/xenstore/xenstored_domain.c Tue Aug 09 08:53:40 2011 +0100 @@ -315,7 +315,7 @@ { struct domain *domain; char *vec[3]; - unsigned int domid; + unsigned int domid, target; unsigned long mfn; evtchn_port_t port; int rc; @@ -326,7 +326,7 @@ return; } - if (conn->id != 0 || !conn->can_write) { + if (!conn->can_write) { send_error(conn, EACCES); return; } @@ -340,19 +340,26 @@ send_error(conn, EINVAL); return; } + /* Allow guest to reset all watches */ + if (domid != DOMID_SELF && conn->id != 0) { + send_error(conn, EACCES); + return; + } - domain = find_domain_by_domid(domid); + target = domid == DOMID_SELF ? conn->id : domid; + + domain = find_domain_by_domid(target); if (domain == NULL) { interface = xc_map_foreign_range( - *xc_handle, domid, + *xc_handle, target, getpagesize(), PROT_READ|PROT_WRITE, mfn); if (!interface) { send_error(conn, errno); return; } /* Hang domain off "in" until we're finished. */ - domain = new_domain(in, domid, port); + domain = new_domain(in, target, port); if (!domain) { munmap(interface, getpagesize()); send_error(conn, errno); @@ -365,11 +372,11 @@ talloc_steal(domain->conn, domain); fire_watches(NULL, "@introduceDomain", false); - } else if ((domain->mfn == mfn) && (domain->conn != conn)) { + } else if ((domain->mfn == mfn) && ((domain->conn != conn) || domid == DOMID_SELF)) { /* Use XS_INTRODUCE for recreating the xenbus event-channel. */ if (domain->port) xc_evtchn_unbind(xce_handle, domain->port); - rc = xc_evtchn_bind_interdomain(xce_handle, domid, port); + rc = xc_evtchn_bind_interdomain(xce_handle, target, port); domain->port = (rc == -1) ? 0 : rc; domain->remote_port = port; } else { _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 09 14:22:51 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 09 Aug 2011 14:22:51 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QqtlD-0007vZ-B1; Tue, 09 Aug 2011 14:22:51 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qqtka-0007o5-VN for xen-changelog@lists.xensource.com; Tue, 09 Aug 2011 14:22:14 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QqtkY-0003Kt-7X for xen-changelog@lists.xensource.com; Tue, 09 Aug 2011 22:22:10 +0100 Message-Id: Date: Tue, 09 Aug 2011 22:22:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: Move init_vm86_tss() back into common code. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1312886020 -3600 # Node ID ea18090ab6e3cb3c69d232ec0865589688db3f81 # Parent f5176c177b9940b7be756ddc61563bc5878e696d hvmloader: Move init_vm86_tss() back into common code. It is not BIOS specific. Signed-off-by: Keir Fraser --- diff -r f5176c177b99 -r ea18090ab6e3 tools/firmware/hvmloader/config.h --- a/tools/firmware/hvmloader/config.h Tue Aug 09 08:53:40 2011 +0100 +++ b/tools/firmware/hvmloader/config.h Tue Aug 09 11:33:40 2011 +0100 @@ -25,7 +25,6 @@ void (*bios_info_setup)(void); void (*bios_info_finish)(void); - void (*vm86_setup)(void); void (*e820_setup)(void); void (*acpi_build_tables)(void); diff -r f5176c177b99 -r ea18090ab6e3 tools/firmware/hvmloader/hvmloader.c --- a/tools/firmware/hvmloader/hvmloader.c Tue Aug 09 08:53:40 2011 +0100 +++ b/tools/firmware/hvmloader/hvmloader.c Tue Aug 09 11:33:40 2011 +0100 @@ -336,6 +336,25 @@ cmos_outb(0x35, (uint8_t)( alt_mem >> 8)); } +/* + * Set up an empty TSS area for virtual 8086 mode to use. + * The only important thing is that it musn't have any bits set + * in the interrupt redirection bitmap, so all zeros will do. + */ +static void init_vm86_tss(void) +{ + void *tss; + struct xen_hvm_param p; + + tss = mem_alloc(128, 128); + memset(tss, 0, 128); + p.domid = DOMID_SELF; + p.index = HVM_PARAM_VM86_TSS; + p.value = virt_to_phys(tss); + hypercall_hvm_op(HVMOP_set_param, &p); + printf("vm86 TSS at %08lx\n", virt_to_phys(tss)); +} + static void apic_setup(void) { /* Set the IOAPIC ID to the static value used in the MP/ACPI tables. */ @@ -506,8 +525,7 @@ hypercall_hvm_op(HVMOP_set_param, &p); } - if ( bios->vm86_setup ) - bios->vm86_setup(); + init_vm86_tss(); cmos_write_memory_size(); diff -r f5176c177b99 -r ea18090ab6e3 tools/firmware/hvmloader/rombios.c --- a/tools/firmware/hvmloader/rombios.c Tue Aug 09 08:53:40 2011 +0100 +++ b/tools/firmware/hvmloader/rombios.c Tue Aug 09 11:33:40 2011 +0100 @@ -40,25 +40,6 @@ #define ROMBIOS_MAXOFFSET 0x0000FFFF #define ROMBIOS_END (ROMBIOS_BEGIN + ROMBIOS_SIZE) -/* - * Set up an empty TSS area for virtual 8086 mode to use. - * The only important thing is that it musn't have any bits set - * in the interrupt redirection bitmap, so all zeros will do. - */ -static void rombios_init_vm86_tss(void) -{ - void *tss; - struct xen_hvm_param p; - - tss = mem_alloc(128, 128); - memset(tss, 0, 128); - p.domid = DOMID_SELF; - p.index = HVM_PARAM_VM86_TSS; - p.value = virt_to_phys(tss); - hypercall_hvm_op(HVMOP_set_param, &p); - printf("vm86 TSS at %08lx\n", virt_to_phys(tss)); -} - static void rombios_setup_e820(void) { /* @@ -178,7 +159,6 @@ .bios_info_setup = rombios_setup_bios_info, .bios_info_finish = NULL, - .vm86_setup = rombios_init_vm86_tss, .e820_setup = rombios_setup_e820, .acpi_build_tables = rombios_acpi_build_tables, diff -r f5176c177b99 -r ea18090ab6e3 tools/firmware/hvmloader/seabios.c --- a/tools/firmware/hvmloader/seabios.c Tue Aug 09 08:53:40 2011 +0100 +++ b/tools/firmware/hvmloader/seabios.c Tue Aug 09 11:33:40 2011 +0100 @@ -143,7 +143,6 @@ .bios_info_setup = seabios_setup_bios_info, .bios_info_finish = seabios_finish_bios_info, - .vm86_setup = NULL, .e820_setup = seabios_setup_e820, .acpi_build_tables = seabios_acpi_build_tables, _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From characarole@advancelectronics.com Wed Aug 10 03:58:58 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 10 Aug 2011 03:58:58 -0700 Received: from [182.183.248.180] (helo=i28iprk.zl) by lists.xensource.com with smtp (Exim 4.43) id 1Qr6Uy-0001T5-PV; Wed, 10 Aug 2011 03:58:58 -0700 MIME-Version: 1.0 Date: Wed, 10 Aug 2011 19:54:18 +0800 From: "TENNIECHEREE" Message-ID: <4e42716a.9a971ed5@advancelectronics.com> Subject: Buy Viagra, Cialis, Levitra and much more. Save on the most popular medications all shipped from USA Pharmacies. To: Content-Type: multipart/alternative; boundary="----=_NextPart_008_0508_1FD8F6C6.9A03BBEC" ------=_NextPart_008_0508_1FD8F6C6.9A03BBEC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Best Buy Viagra Generic Online Viagra 100mg x 100 Pills $125, Free Pills & Reorder Discount. We accept VISA & E-Check Payments, 90000+ Satisfied Customers! Top Selling 100% Quality & Satisfaction guaranteed! http://tabletsmedicmeds.ru ------=_NextPart_008_0508_1FD8F6C6.9A03BBEC Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Best Buy Viagra Generic Online

Viagra 100mg x 100 Pills $125, Free Pills & Reorder Discount. We accept VISA & E-Check Payments, 90000+ Satisfied Customers!

Top Selling 100% Quality & Satisfaction guaranteed!
------=_NextPart_008_0508_1FD8F6C6.9A03BBEC-- From myrticestefanie@bp.com Wed Aug 10 05:08:46 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 10 Aug 2011 05:08:46 -0700 Received: from [89.123.190.192] (helo=m0ylwtxg) by lists.xensource.com with smtp (Exim 4.43) id 1Qr7aX-000463-DH; Wed, 10 Aug 2011 05:08:46 -0700 MIME-Version: 1.0 Date: Wed, 10 Aug 2011 10:03:34 -0300 Subject: Viagra 50/100 mg. Bonus pills - 24h online support, Absolute anonymity & Fast delivery by airmail or courier From: "MerrillVasiliki" To: Message-ID: <201108101706.22DF6DB4B7E54A2E88B7C639@ytg46b77if> Content-Type: multipart/alternative; boundary="----=_NextPart_009_0835_5C5FAD5A.CECE35D0" ------=_NextPart_009_0835_5C5FAD5A.CECE35D0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit #1 - Viagra - Online Drug Store, Guaranteed Quality Centre 24h online support, Absolute anonymity & Fast delivery by airmail or courier Viagra 50/100 mg. Bonus pills Discounts and FREE SHIPPING applied! http://pharmacyfitnessdrugstore.ru ------=_NextPart_009_0835_5C5FAD5A.CECE35D0 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit
Buy VIAGRA Now From $0.99 & Get 12 bonus pills FREE!

Buy VIAGRA online. Best online pharmacies to buy Viagra.

Order Viagra online with huge discount
Don't miss these prices!
------=_NextPart_009_0835_5C5FAD5A.CECE35D0-- From xen-changelog-bounces@lists.xensource.com Thu Aug 11 03:23:15 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 11 Aug 2011 03:23:15 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QrSPz-0005UH-E0; Thu, 11 Aug 2011 03:23:15 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QrSOw-00054a-U0 for xen-changelog@lists.xensource.com; Thu, 11 Aug 2011 03:22:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QrSOv-0008Ie-KV for xen-changelog@lists.xensource.com; Thu, 11 Aug 2011 11:22:09 +0100 Message-Id: Date: Thu, 11 Aug 2011 11:22:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] ACPI ERST: Revert change to erst_check_table() to be more permissive. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1312909603 -3600 # Node ID ae10d7804168c185166277bcef3b18ffc9227b66 # Parent aca07ff1f0a59cc7ebb5ef76875229b7e99ba3ff ACPI ERST: Revert change to erst_check_table() to be more permissive. Permits tables that apparently Xen cannot handle (causes boot failure on many systems). Signed-off-by: Keir Fraser --- diff -r aca07ff1f0a5 -r ae10d7804168 xen/drivers/acpi/apei/erst.c --- a/xen/drivers/acpi/apei/erst.c Tue Aug 09 17:48:16 2011 +0100 +++ b/xen/drivers/acpi/apei/erst.c Tue Aug 09 18:06:43 2011 +0100 @@ -715,13 +715,7 @@ static int __init erst_check_table(struct acpi_table_erst *erst_tab) { - /* - * Some old BIOSes include the ACPI standard header in the ERST header - * length; new BIOSes do not. Our check allows for both methods. - */ - if ((erst_tab->header_length != - (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) - && (erst_tab->header_length != sizeof(struct acpi_table_erst))) + if (erst_tab->header_length != sizeof(struct acpi_table_erst)) return -EINVAL; if (erst_tab->header.length < sizeof(struct acpi_table_erst)) return -EINVAL; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 11 03:23:24 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 11 Aug 2011 03:23:24 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QrSQ7-0005Xi-To; Thu, 11 Aug 2011 03:23:23 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QrSOw-00054d-Tz for xen-changelog@lists.xensource.com; Thu, 11 Aug 2011 03:22:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QrSOw-0008Iu-5v for xen-changelog@lists.xensource.com; Thu, 11 Aug 2011 11:22:10 +0100 Message-Id: Date: Thu, 11 Aug 2011 11:22:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] hvmloader: relicense hvmloader xenbus implementation under more X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Ian Campbell # Date 1312983814 -3600 # Node ID 1f08b380d4386cdd6714786a9163e5f51aecab5d # Parent ae10d7804168c185166277bcef3b18ffc9227b66 hvmloader: relicense hvmloader xenbus implementation under more liberal terms. This code is a great example of a simple xenbus implementation and we would like to reuse it in projects with non-GPLv2 license (specifically in this case SeaBIOS which is GPLv3). I picked the license from extras/mini-os/COPYING (A two clause BSD style license) since mini-os exists for much the same purpose. Signed-off-by: Ian Campbell Acked-by: Tim Deegan Acked-by: Keir Fraser --- diff -r ae10d7804168 -r 1f08b380d438 tools/firmware/hvmloader/xenbus.c --- a/tools/firmware/hvmloader/xenbus.c Tue Aug 09 18:06:43 2011 +0100 +++ b/tools/firmware/hvmloader/xenbus.c Wed Aug 10 14:43:34 2011 +0100 @@ -3,18 +3,26 @@ * * Copyright (c) 2009 Tim Deegan, Citrix Systems (R&D) Ltd. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307 USA. + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include "util.h" _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From carlenalarae@cho.ge.com Thu Aug 11 04:57:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 11 Aug 2011 04:57:50 -0700 Received: from 109-184-81-57.dynamic.mts-nn.ru ([109.184.81.57] helo=5vfbqn9x.ky) by lists.xensource.com with smtp (Exim 4.43) id 1QrTtU-0000L9-1n; Thu, 11 Aug 2011 04:57:49 -0700 To: Message-ID: <99o48l57r74-04229242-320e7t71@xllzkztqsl> Subject: Join the wise shoppers to let your dreams come true. BEST deals of imitation watches plus FREE shipping! From: "NadiaLeia" MIME-Version: 1.0 Date: Thu, 11 Aug 2011 16:51:58 +0400 Content-Type: multipart/alternative; boundary="----=_NextPart_006_04A3_EAA979AA.10664976" ------=_NextPart_006_04A3_EAA979AA.10664976 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Imitation Watches at Replica Watches TOP grade Replica Watches of high quality at wholesale prices! Join the wise shoppers to let your dreams come true. BEST deals of imitation watches plus FREE shipping! http://watchsalereview.ru ------=_NextPart_006_04A3_EAA979AA.10664976 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Imitation Watches at Replica Watches

TOP grade Replica Watches of high quality at wholesale prices!
Join the wise shoppers to let your dreams come true.
BEST deals of imitation watches plus FREE shipping!
------=_NextPart_006_04A3_EAA979AA.10664976-- From xen-changelog-bounces@lists.xensource.com Fri Aug 12 09:25:06 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 12 Aug 2011 09:25:06 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QruXi-000527-C5; Fri, 12 Aug 2011 09:25:06 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QruV5-0003nt-RI for xen-changelog@lists.xensource.com; Fri, 12 Aug 2011 09:22:24 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QruV3-0005FF-4n for xen-changelog@lists.xensource.com; Fri, 12 Aug 2011 17:22:21 +0100 Message-Id: Date: Fri, 12 Aug 2011 17:22:19 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Passthrough: disable bus-mastering on any card that causes an IOMMU fault. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1313145221 -3600 # Node ID 84e3706df07a1963e23cd3875d8603917657d462 # Parent cb22fa57ff252893b6adb1481e09b1287eacd990 Passthrough: disable bus-mastering on any card that causes an IOMMU fault. This stops the card from raising back-to-back faults and live-locking the CPU that handles them. Signed-off-by: Tim Deegan Acked-by: Wei Wang2 Acked-by: Allen M Kay --- diff -r cb22fa57ff25 -r 84e3706df07a xen/drivers/passthrough/amd/iommu_init.c --- a/xen/drivers/passthrough/amd/iommu_init.c Mon Jul 25 16:48:39 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_init.c Fri Aug 12 11:33:41 2011 +0100 @@ -462,7 +462,7 @@ static void parse_event_log_entry(u32 entry[]) { - u16 domain_id, device_id; + u16 domain_id, device_id, bdf, cword; u32 code; u64 *addr; char * event_str[] = {"ILLEGAL_DEV_TABLE_ENTRY", @@ -497,6 +497,18 @@ "%s: domain = %d, device id = 0x%04x, " "fault address = 0x%"PRIx64"\n", event_str[code-1], domain_id, device_id, *addr); + + /* Tell the device to stop DMAing; we can't rely on the guest to + * control it for us. */ + for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ ) + if ( get_dma_requestor_id(bdf) == device_id ) + { + cword = pci_conf_read16(PCI_BUS(bdf), PCI_SLOT(bdf), + PCI_FUNC(bdf), PCI_COMMAND); + pci_conf_write16(PCI_BUS(bdf), PCI_SLOT(bdf), + PCI_FUNC(bdf), PCI_COMMAND, + cword & ~PCI_COMMAND_MASTER); + } } else { diff -r cb22fa57ff25 -r 84e3706df07a xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Mon Jul 25 16:48:39 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Fri Aug 12 11:33:41 2011 +0100 @@ -893,7 +893,7 @@ while (1) { u8 fault_reason; - u16 source_id; + u16 source_id, cword; u32 data; u64 guest_addr; int type; @@ -926,6 +926,14 @@ iommu_page_fault_do_one(iommu, type, fault_reason, source_id, guest_addr); + /* Tell the device to stop DMAing; we can't rely on the guest to + * control it for us. */ + cword = pci_conf_read16(PCI_BUS(source_id), PCI_SLOT(source_id), + PCI_FUNC(source_id), PCI_COMMAND); + pci_conf_write16(PCI_BUS(source_id), PCI_SLOT(source_id), + PCI_FUNC(source_id), PCI_COMMAND, + cword & ~PCI_COMMAND_MASTER); + fault_index++; if ( fault_index > cap_num_fault_regs(iommu->cap) ) fault_index = 0; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From yolandoleonia@unidial.com Fri Aug 12 21:37:15 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 12 Aug 2011 21:37:15 -0700 Received: from [94.51.162.2] (helo=ot7c49iqrq.tzntffvch1.rp) by lists.xensource.com with smtp (Exim 4.43) id 1Qs5yE-0006IS-4d; Fri, 12 Aug 2011 21:37:14 -0700 Subject: Top Penis Enlargement and Male Enhancement Products in the market. MIME-Version: 1.0 Date: Sat, 13 Aug 2011 08:32:02 +0300 Message-ID: <94y90h28w43-91193556-760w4p90@fqxetdcpin> To: From: "RosenaCarletta" Content-Type: multipart/alternative; boundary="----=_NextPart_005_090D_5BA414CB.9BD5545C" ------=_NextPart_005_090D_5BA414CB.9BD5545C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Best Penis Enlargement Products Here! Top Penis Enlargement and Male Enhancement Products in the market. Only the Best Penis Enlargement Products in one place! Visit Now! http://penislargegeek.ru ------=_NextPart_005_090D_5BA414CB.9BD5545C Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Best Penis Enlargement Products Here!

Top Penis Enlargement and Male Enhancement Products in the market. Only the Best Penis Enlargement Products in one place!

Visit Now!
------=_NextPart_005_090D_5BA414CB.9BD5545C-- From jeninerebecca@gatesalbert.com Sat Aug 13 00:48:52 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Sat, 13 Aug 2011 00:48:52 -0700 Received: from [115.242.76.159] (helo=6lkk4itp.pz) by lists.xensource.com with smtp (Exim 4.43) id 1Qs8xf-0004Df-1g; Sat, 13 Aug 2011 00:48:52 -0700 Subject: BEST quality generic CIALIS with 100% satisfaction guaranteed! Get 12 bonus pills FREE! Message-ID: <4e4639a1.3db5bd11@gatesalbert.com> From: "JeannettaOlivia" To: Date: Sat, 13 Aug 2011 03:45:21 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_007_0596_6E9A11FD.354D36AF" ------=_NextPart_007_0596_6E9A11FD.354D36AF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cialis Cialis 2.5mg x 40 = $78.00 [$1.95/pill] Buy Cialis (Brand) or Generic Cialis (Tadalafil) online WITHOUT PRESCRIPTION! We accept VISA, AMEX, E-Check. Shipping: EMS, USPS. http://assaystorepillspharmacy.ru ------=_NextPart_007_0596_6E9A11FD.354D36AF Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Cialis Cialis 2.5mg x 40 = $78.00 [$1.95/pill]
Buy Cialis (Brand) or Generic Cialis (Tadalafil) online WITHOUT PRESCRIPTION!
We accept VISA, AMEX, E-Check. Shipping: EMS, USPS.
------=_NextPart_007_0596_6E9A11FD.354D36AF-- From mechelleeustolia@verio.com Sat Aug 13 11:56:40 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Sat, 13 Aug 2011 11:56:40 -0700 Received: from [182.186.186.125] (helo=fadiokwf7u0.net) by lists.xensource.com with smtp (Exim 4.43) id 1QsJNu-0004vT-Ok; Sat, 13 Aug 2011 11:56:40 -0700 MIME-Version: 1.0 From: "GlindaRheba" Subject: VIAGRA 100mg/90pills $119 FREE Shipping! Generic Viagra, Cialis, Levitra Low Price! To: Date: Sat, 13 Aug 2011 12:52:29 -0700 Message-ID: <69p33b70r31-60377534-865y4w84@egqvsat> Content-Type: multipart/alternative; boundary="----=_NextPart_002_0AE1_8C41D16D.AB27D201" ------=_NextPart_002_0AE1_8C41D16D.AB27D201 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit VIAGRA 100mg/90pills $119 FREE Shipping! Generic Viagra, Cialis, Levitra Low Price! Express delivery USA to USA 1-3 days! http://insurancemedsrx.ru ------=_NextPart_002_0AE1_8C41D16D.AB27D201 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit
VIAGRA 100mg/90pills $119 FREE Shipping!

Generic Viagra, Cialis, Levitra Low Price!

Express delivery USA to USA 1-3 days!
------=_NextPart_002_0AE1_8C41D16D.AB27D201-- From garnetjayku@oracle.com Sun Aug 14 12:14:27 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Sun, 14 Aug 2011 12:14:27 -0700 Received: from ppp-157-255.28-151.libero.it ([151.28.255.157] helo=joqrg7fx.isrgee2.aynidy7rzs8k.go) by lists.xensource.com with smtp (Exim 4.43) id 1Qsg8e-0007SW-A6; Sun, 14 Aug 2011 12:14:27 -0700 MIME-Version: 1.0 Reply-To: "Garnet Jay" Message-ID: <70f18c56d65-61564988-121h9x25@lzzcdvys> To: Date: Sun, 14 Aug 2011 21:10:54 +0100 From: "Garnet Jay" Subject: Buy real viagra online without prescription. #1 – Buy viagra cialis levitra Content-Type: multipart/alternative; boundary="----=_NextPart_006_02D3_4D2046F8.91E3BAA6" ------=_NextPart_006_02D3_4D2046F8.91E3BAA6 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit #1 – Buy viagra cialis levitra Approved Canadian Healthcare, Best ... Buy viagra cialis levitra, viagra online cialis no prescription EXTRA LOW PRICES! Buy real viagra online without prescription. http://rxdrugsfuture.ru ------=_NextPart_006_02D3_4D2046F8.91E3BAA6 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit
##@1 – Buy viagra cialis levitra

Approved Canadian Healthcare, Best ... Buy viagra cialis levitra, viagra online cialis no prescription EXTRA LOW PRICES!

Buy real viagra online without prescription.
------=_NextPart_006_02D3_4D2046F8.91E3BAA6-- From xen-changelog-bounces@lists.xensource.com Mon Aug 15 09:55:16 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 15 Aug 2011 09:55:16 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0RY-00014F-I9; Mon, 15 Aug 2011 09:55:16 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0RU-000138-78 for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 09:55:12 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qt0RS-0002jC-Py for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 17:55:10 +0100 Message-Id: Date: Mon, 15 Aug 2011 17:55:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Passthrough: disable bus-mastering on any card that causes an IOMMU fault. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1313144964 -3600 # Node ID 537ed3b74b3f13267cfb3eb0e1483f432f3685cd # Parent 1f08b380d4386cdd6714786a9163e5f51aecab5d Passthrough: disable bus-mastering on any card that causes an IOMMU fault. This stops the card from raising back-to-back faults and live-locking the CPU that handles them. Signed-off-by: Tim Deegan Acked-by: Wei Wang2 Acked-by: Allen M Kay --- diff -r 1f08b380d438 -r 537ed3b74b3f xen/drivers/passthrough/amd/iommu_init.c --- a/xen/drivers/passthrough/amd/iommu_init.c Wed Aug 10 14:43:34 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_init.c Fri Aug 12 11:29:24 2011 +0100 @@ -461,7 +461,7 @@ static void parse_event_log_entry(u32 entry[]) { - u16 domain_id, device_id; + u16 domain_id, device_id, bdf, cword; u32 code; u64 *addr; char * event_str[] = {"ILLEGAL_DEV_TABLE_ENTRY", @@ -496,6 +496,18 @@ "%s: domain = %d, device id = 0x%04x, " "fault address = 0x%"PRIx64"\n", event_str[code-1], domain_id, device_id, *addr); + + /* Tell the device to stop DMAing; we can't rely on the guest to + * control it for us. */ + for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ ) + if ( get_requestor_id(bdf) == device_id ) + { + cword = pci_conf_read16(PCI_BUS(bdf), PCI_SLOT(bdf), + PCI_FUNC(bdf), PCI_COMMAND); + pci_conf_write16(PCI_BUS(bdf), PCI_SLOT(bdf), + PCI_FUNC(bdf), PCI_COMMAND, + cword & ~PCI_COMMAND_MASTER); + } } else { diff -r 1f08b380d438 -r 537ed3b74b3f xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Wed Aug 10 14:43:34 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Fri Aug 12 11:29:24 2011 +0100 @@ -884,7 +884,7 @@ while (1) { u8 fault_reason; - u16 source_id; + u16 source_id, cword; u32 data; u64 guest_addr; int type; @@ -917,6 +917,14 @@ iommu_page_fault_do_one(iommu, type, fault_reason, source_id, guest_addr); + /* Tell the device to stop DMAing; we can't rely on the guest to + * control it for us. */ + cword = pci_conf_read16(PCI_BUS(source_id), PCI_SLOT(source_id), + PCI_FUNC(source_id), PCI_COMMAND); + pci_conf_write16(PCI_BUS(source_id), PCI_SLOT(source_id), + PCI_FUNC(source_id), PCI_COMMAND, + cword & ~PCI_COMMAND_MASTER); + fault_index++; if ( fault_index > cap_num_fault_regs(iommu->cap) ) fault_index = 0; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 15 09:55:25 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 15 Aug 2011 09:55:25 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0Rh-00017m-I8; Mon, 15 Aug 2011 09:55:25 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0RU-000139-76 for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 09:55:12 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qt0RT-0002l1-FR for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 17:55:11 +0100 Message-Id: Date: Mon, 15 Aug 2011 17:55:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] VT-d: don't reject valid DMAR/ATSR tables on systems with multiple PCI segments X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313226769 -3600 # Node ID 8f647d409196f1d018f6284af03d1625cf8f93af # Parent 537ed3b74b3f13267cfb3eb0e1483f432f3685cd VT-d: don't reject valid DMAR/ATSR tables on systems with multiple PCI segments On multi-PCI-segment systems, each segment has to be expected to have an include-all DRHD and an all-ports ATSR, so the firmware consistency check incorrectly rejects valid configurations there (which is particularly problematic when the firmware also pre-enabled x2apic mode, as the system will panic in that case due to being unable to enable interrupt remapping). Thus constrain the check to just segment 0 for now; once full multi-segment support is there (which I'm working on), it can be revisited whether we'd want to track this per segment, or whether we trust the firmware of such large systems. Signed-off-by: Jan Beulich --- diff -r 537ed3b74b3f -r 8f647d409196 xen/drivers/passthrough/vtd/dmar.c --- a/xen/drivers/passthrough/vtd/dmar.c Fri Aug 12 11:29:24 2011 +0100 +++ b/xen/drivers/passthrough/vtd/dmar.c Sat Aug 13 10:12:49 2011 +0100 @@ -418,13 +418,14 @@ if ( iommu_verbose ) dprintk(VTDPREFIX, " flags: INCLUDE_ALL\n"); /* Only allow one INCLUDE_ALL */ - if ( include_all ) + if ( drhd->segment == 0 && include_all ) { dprintk(XENLOG_WARNING VTDPREFIX, "Only one INCLUDE_ALL device scope is allowed\n"); ret = -EINVAL; } - include_all = 1; + if ( drhd->segment == 0 ) + include_all = 1; } if ( ret ) @@ -624,13 +625,14 @@ if ( iommu_verbose ) dprintk(VTDPREFIX, " flags: ALL_PORTS\n"); /* Only allow one ALL_PORTS */ - if ( all_ports ) + if ( atsr->segment == 0 && all_ports ) { dprintk(XENLOG_WARNING VTDPREFIX, "Only one ALL_PORTS device scope is allowed\n"); ret = -EINVAL; } - all_ports = 1; + if ( atsr->segment == 0 ) + all_ports = 1; } if ( ret ) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 15 09:55:34 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 15 Aug 2011 09:55:34 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0Rq-0001Ap-A1; Mon, 15 Aug 2011 09:55:34 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0RU-00013A-Nl for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 09:55:12 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qt0RT-0002lx-W2 for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 17:55:11 +0100 Message-Id: Date: Mon, 15 Aug 2011 17:55:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86/amd: Add support for read-only APERF/MPERF X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Mark Langsdorf # Date 1313226818 -3600 # Node ID 67b883402736ef1746cd6654da4c898f70f40723 # Parent 8f647d409196f1d018f6284af03d1625cf8f93af x86/amd: Add support for read-only APERF/MPERF AMD is adding support for a read-only mode of the APERF and MPERF MSRs. When this mode is enabled, writes to these registers are ignored and do no reset the registers. This allows multiple well-behaved programs to share the use of the registers even if a poorly behaved program attempts to reset them. Support for this feature is indicated by a CPUID bit. AMD has been recommending that well-behaved software avoid resetting the APERF and MPERF MSRs. Enabling this feature should not change the behavior of well- behaved software. This change has been tested with the turbostat and cpufreq-aperf applications. Signed-off-by: Mark Langsdorf --- diff -r 8f647d409196 -r 67b883402736 xen/arch/x86/cpu/amd.c --- a/xen/arch/x86/cpu/amd.c Sat Aug 13 10:12:49 2011 +0100 +++ b/xen/arch/x86/cpu/amd.c Sat Aug 13 10:13:38 2011 +0100 @@ -499,6 +499,12 @@ if (c->x86 > 0xf && !cpu_has_amd_erratum(c, AMD_ERRATUM_400)) set_bit(X86_FEATURE_ARAT, c->x86_capability); + if (cpuid_edx(0x80000007) & (1 << 10)) { + rdmsr(MSR_K7_HWCR, l, h); + l |= (1 << 27); /* Enable read-only APERF/MPERF bit */ + wrmsr(MSR_K7_HWCR, l, h); + } + /* Prevent TSC drift in non single-processor, single-core platforms. */ if ((smp_processor_id() == 1) && c1_ramping_may_cause_clock_drift(c)) disable_c1_ramping(); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 15 09:55:43 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 15 Aug 2011 09:55:43 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0Rz-0001E8-2N; Mon, 15 Aug 2011 09:55:43 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0RV-00013W-RH for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 09:55:14 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qt0RV-0002nu-2G for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 17:55:13 +0100 Message-Id: Date: Mon, 15 Aug 2011 17:55:12 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86/PCI-MSI: properly determine VF BAR values X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313226898 -3600 # Node ID 8d6edc3d26d26931f3732a2008fb4818bc7bab2d # Parent 68b903bb1b01b2a6ef9c6e8ead3be3c1c2208341 x86/PCI-MSI: properly determine VF BAR values As was discussed a couple of times on this list, SR-IOV virtual functions have their BARs read as zero - the physical function's SR-IOV capability structure must be consulted instead. The bogus warnings people complained about are being eliminated with this change. Signed-off-by: Jan Beulich --- diff -r 68b903bb1b01 -r 8d6edc3d26d2 xen/arch/x86/msi.c --- a/xen/arch/x86/msi.c Sat Aug 13 10:14:28 2011 +0100 +++ b/xen/arch/x86/msi.c Sat Aug 13 10:14:58 2011 +0100 @@ -522,12 +522,48 @@ return 0; } -static u64 read_pci_mem_bar(u8 bus, u8 slot, u8 func, u8 bir) +static u64 read_pci_mem_bar(u8 bus, u8 slot, u8 func, u8 bir, int vf) { u8 limit; - u32 addr; + u32 addr, base = PCI_BASE_ADDRESS_0, disp = 0; - switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) & 0x7f ) + if ( vf >= 0 ) + { + struct pci_dev *pdev = pci_get_pdev(bus, PCI_DEVFN(slot, func)); + unsigned int pos = pci_find_ext_capability(0, bus, + PCI_DEVFN(slot, func), + PCI_EXT_CAP_ID_SRIOV); + u16 ctrl = pci_conf_read16(bus, slot, func, pos + PCI_SRIOV_CTRL); + u16 num_vf = pci_conf_read16(bus, slot, func, pos + PCI_SRIOV_NUM_VF); + u16 offset = pci_conf_read16(bus, slot, func, + pos + PCI_SRIOV_VF_OFFSET); + u16 stride = pci_conf_read16(bus, slot, func, + pos + PCI_SRIOV_VF_STRIDE); + + if ( !pdev || !pos || + !(ctrl & PCI_SRIOV_CTRL_VFE) || + !(ctrl & PCI_SRIOV_CTRL_MSE) || + !num_vf || !offset || (num_vf > 1 && !stride) || + bir >= PCI_SRIOV_NUM_BARS || + !pdev->vf_rlen[bir] ) + return 0; + base = pos + PCI_SRIOV_BAR; + vf -= PCI_BDF(bus, slot, func) + offset; + if ( vf < 0 || (vf && vf % stride) ) + return 0; + if ( stride ) + { + if ( vf % stride ) + return 0; + vf /= stride; + } + if ( vf >= num_vf ) + return 0; + BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS); + disp = vf * pdev->vf_rlen[bir]; + limit = PCI_SRIOV_NUM_BARS; + } + else switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) & 0x7f ) { case PCI_HEADER_TYPE_NORMAL: limit = 6; @@ -544,7 +580,7 @@ if ( bir >= limit ) return 0; - addr = pci_conf_read32(bus, slot, func, PCI_BASE_ADDRESS_0 + bir * 4); + addr = pci_conf_read32(bus, slot, func, base + bir * 4); if ( (addr & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO ) return 0; if ( (addr & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64 ) @@ -552,11 +588,10 @@ addr &= PCI_BASE_ADDRESS_MEM_MASK; if ( ++bir >= limit ) return 0; - return addr | - ((u64)pci_conf_read32(bus, slot, func, - PCI_BASE_ADDRESS_0 + bir * 4) << 32); + return addr + disp + + ((u64)pci_conf_read32(bus, slot, func, base + bir * 4) << 32); } - return addr & PCI_BASE_ADDRESS_MEM_MASK; + return (addr & PCI_BASE_ADDRESS_MEM_MASK) + disp; } /** @@ -629,11 +664,29 @@ if ( !dev->msix_nr_entries ) { + u8 pbus, pslot, pfunc; + int vf; u64 pba_paddr; u32 pba_offset; + if ( !dev->info.is_virtfn ) + { + pbus = bus; + pslot = slot; + pfunc = func; + vf = -1; + } + else + { + pbus = dev->info.physfn.bus; + pslot = PCI_SLOT(dev->info.physfn.devfn); + pfunc = PCI_FUNC(dev->info.physfn.devfn); + vf = PCI_BDF2(dev->bus, dev->devfn); + } + ASSERT(!dev->msix_used_entries); - WARN_ON(msi->table_base != read_pci_mem_bar(bus, slot, func, bir)); + WARN_ON(msi->table_base != + read_pci_mem_bar(pbus, pslot, pfunc, bir, vf)); dev->msix_nr_entries = nr_entries; dev->msix_table.first = PFN_DOWN(table_paddr); @@ -645,7 +698,7 @@ pba_offset = pci_conf_read32(bus, slot, func, msix_pba_offset_reg(pos)); bir = (u8)(pba_offset & PCI_MSIX_BIRMASK); - pba_paddr = read_pci_mem_bar(bus, slot, func, bir); + pba_paddr = read_pci_mem_bar(pbus, pslot, pfunc, bir, vf); WARN_ON(!pba_paddr); pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK; diff -r 68b903bb1b01 -r 8d6edc3d26d2 xen/drivers/passthrough/pci.c --- a/xen/drivers/passthrough/pci.c Sat Aug 13 10:14:28 2011 +0100 +++ b/xen/drivers/passthrough/pci.c Sat Aug 13 10:14:58 2011 +0100 @@ -146,6 +146,7 @@ int pci_add_device(u8 bus, u8 devfn, const struct pci_dev_info *info) { struct pci_dev *pdev; + unsigned int slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn); const char *pdev_type; int ret = -ENOMEM; @@ -154,7 +155,14 @@ else if (info->is_extfn) pdev_type = "extended function"; else if (info->is_virtfn) + { + spin_lock(&pcidevs_lock); + pdev = pci_get_pdev(info->physfn.bus, info->physfn.devfn); + spin_unlock(&pcidevs_lock); + if ( !pdev ) + pci_add_device(info->physfn.bus, info->physfn.devfn, NULL); pdev_type = "virtual function"; + } else return -EINVAL; @@ -165,6 +173,70 @@ if ( info ) pdev->info = *info; + else if ( !pdev->vf_rlen[0] ) + { + unsigned int pos = pci_find_ext_capability(0, bus, devfn, + PCI_EXT_CAP_ID_SRIOV); + u16 ctrl = pci_conf_read16(bus, slot, func, pos + PCI_SRIOV_CTRL); + + if ( !pos ) + /* Nothing */; + else if ( !(ctrl & (PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE)) ) + { + unsigned int i; + + BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS); + for ( i = 0; i < PCI_SRIOV_NUM_BARS; ++i ) + { + unsigned int idx = pos + PCI_SRIOV_BAR + i * 4; + u32 bar = pci_conf_read32(bus, slot, func, idx); + u32 hi = 0; + + if ( (bar & PCI_BASE_ADDRESS_SPACE) == + PCI_BASE_ADDRESS_SPACE_IO ) + { + printk(XENLOG_WARNING "SR-IOV device %02x:%02x.%x with vf" + " BAR%u in IO space\n", + bus, slot, func, i); + continue; + } + pci_conf_write32(bus, slot, func, idx, ~0); + if ( (bar & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == + PCI_BASE_ADDRESS_MEM_TYPE_64 ) + { + if ( i >= PCI_SRIOV_NUM_BARS ) + { + printk(XENLOG_WARNING "SR-IOV device %02x:%02x.%x with" + " 64-bit vf BAR in last slot\n", + bus, slot, func); + break; + } + hi = pci_conf_read32(bus, slot, func, idx + 4); + pci_conf_write32(bus, slot, func, idx + 4, ~0); + } + pdev->vf_rlen[i] = pci_conf_read32(bus, slot, func, idx) & + PCI_BASE_ADDRESS_MEM_MASK; + if ( (bar & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == + PCI_BASE_ADDRESS_MEM_TYPE_64 ) + { + pdev->vf_rlen[i] |= (u64)pci_conf_read32(bus, slot, func, + idx + 4) << 32; + pci_conf_write32(bus, slot, func, idx + 4, hi); + } + else if ( pdev->vf_rlen[i] ) + pdev->vf_rlen[i] |= (u64)~0 << 32; + pci_conf_write32(bus, slot, func, idx, bar); + pdev->vf_rlen[i] = -pdev->vf_rlen[i]; + if ( (bar & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == + PCI_BASE_ADDRESS_MEM_TYPE_64 ) + ++i; + } + } + else + printk(XENLOG_WARNING "SR-IOV device %02x:%02x.%x has its virtual" + " functions already enabled (%04x)\n", + bus, slot, func, ctrl); + } ret = 0; if ( !pdev->domain ) @@ -184,7 +256,7 @@ out: spin_unlock(&pcidevs_lock); printk(XENLOG_DEBUG "PCI add %s %02x:%02x.%x\n", pdev_type, - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + bus, slot, func); return ret; } diff -r 68b903bb1b01 -r 8d6edc3d26d2 xen/include/xen/pci.h --- a/xen/include/xen/pci.h Sat Aug 13 10:14:28 2011 +0100 +++ b/xen/include/xen/pci.h Sat Aug 13 10:14:58 2011 +0100 @@ -59,6 +59,7 @@ const u8 bus; const u8 devfn; struct pci_dev_info info; + u64 vf_rlen[6]; }; #define for_each_pdev(domain, pdev) \ diff -r 68b903bb1b01 -r 8d6edc3d26d2 xen/include/xen/pci_regs.h --- a/xen/include/xen/pci_regs.h Sat Aug 13 10:14:28 2011 +0100 +++ b/xen/include/xen/pci_regs.h Sat Aug 13 10:14:58 2011 +0100 @@ -425,7 +425,7 @@ #define PCI_EXT_CAP_ID_ACS 13 #define PCI_EXT_CAP_ID_ARI 14 #define PCI_EXT_CAP_ID_ATS 15 -#define PCI_EXT_CAP_ID_IOV 16 +#define PCI_EXT_CAP_ID_SRIOV 16 /* Advanced Error Reporting */ #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ @@ -545,4 +545,35 @@ #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ +/* Single Root I/O Virtualization */ +#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ +#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ +#define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */ +#define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */ +#define PCI_SRIOV_CTRL_VFE 0x01 /* VF Enable */ +#define PCI_SRIOV_CTRL_VFM 0x02 /* VF Migration Enable */ +#define PCI_SRIOV_CTRL_INTR 0x04 /* VF Migration Interrupt Enable */ +#define PCI_SRIOV_CTRL_MSE 0x08 /* VF Memory Space Enable */ +#define PCI_SRIOV_CTRL_ARI 0x10 /* ARI Capable Hierarchy */ +#define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */ +#define PCI_SRIOV_STATUS_VFM 0x01 /* VF Migration Status */ +#define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */ +#define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */ +#define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */ +#define PCI_SRIOV_FUNC_LINK 0x12 /* Function Dependency Link */ +#define PCI_SRIOV_VF_OFFSET 0x14 /* First VF Offset */ +#define PCI_SRIOV_VF_STRIDE 0x16 /* Following VF Stride */ +#define PCI_SRIOV_VF_DID 0x1a /* VF Device ID */ +#define PCI_SRIOV_SUP_PGSIZE 0x1c /* Supported Page Sizes */ +#define PCI_SRIOV_SYS_PGSIZE 0x20 /* System Page Size */ +#define PCI_SRIOV_BAR 0x24 /* VF BAR0 */ +#define PCI_SRIOV_NUM_BARS 6 /* Number of VF BARs */ +#define PCI_SRIOV_VFM 0x3c /* VF Migration State Array Offset*/ +#define PCI_SRIOV_VFM_BIR(x) ((x) & 7) /* State BIR */ +#define PCI_SRIOV_VFM_OFFSET(x) ((x) & ~7) /* State Offset */ +#define PCI_SRIOV_VFM_UA 0x0 /* Inactive.Unavailable */ +#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ +#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ +#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ + #endif /* LINUX_PCI_REGS_H */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 15 09:55:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 15 Aug 2011 09:55:50 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0S6-0001HT-20; Mon, 15 Aug 2011 09:55:50 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qt0RV-00013L-95 for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 09:55:14 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qt0RU-0002mt-Gk for xen-changelog@lists.xensource.com; Mon, 15 Aug 2011 17:55:12 +0100 Message-Id: Date: Mon, 15 Aug 2011 17:55:12 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: IRQ fix incorrect logic in __clear_irq_vector X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Andrew Cooper # Date 1313226868 -3600 # Node ID 68b903bb1b01b2a6ef9c6e8ead3be3c1c2208341 # Parent 67b883402736ef1746cd6654da4c898f70f40723 x86: IRQ fix incorrect logic in __clear_irq_vector In the old code, tmp_mask is the cpu_and of cfg->cpu_mask and cpu_online_map. However, in the usual case of moving an IRQ from one PCPU to another because the scheduler decides its a good idea, cfg->cpu_mask and cfg->old_cpu_mask do not intersect. This causes the old cpu vector_irq table to keep the irq reference when it shouldn't. This leads to a resource leak if a domain is shut down wile an irq has a move pending, which results in Xen's create_irq() eventually failing with -ENOSPC when all vector_irq tables are full of stale references. Signed-off-by: Andrew Cooper --- diff -r 67b883402736 -r 68b903bb1b01 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Sat Aug 13 10:13:38 2011 +0100 +++ b/xen/arch/x86/irq.c Sat Aug 13 10:14:28 2011 +0100 @@ -216,6 +216,7 @@ if (likely(!cfg->move_in_progress)) return; + cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map); for_each_cpu_mask(cpu, tmp_mask) { for (vector = FIRST_DYNAMIC_VECTOR; vector <= LAST_DYNAMIC_VECTOR; vector++) { _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 16 22:01:47 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 16 Aug 2011 22:01:47 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYGA-00047z-Tp; Tue, 16 Aug 2011 22:01:47 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYEq-00045f-NR for xen-changelog@lists.xensource.com; Tue, 16 Aug 2011 22:00:46 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QtYEo-0006Or-2i for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 06:00:22 +0100 Message-Id: Date: Wed, 17 Aug 2011 06:00:21 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Revert 23092:0f2b9b6c5a74 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1313504059 -3600 # Node ID c8987be040d03acf69b068379ba063c446ce97ac # Parent 84e3706df07a1963e23cd3875d8603917657d462 Revert 23092:0f2b9b6c5a74 It has broken unmodified Windows HVM guests for some users: Signed-off-by: Keir Fraser --- diff -r 84e3706df07a -r c8987be040d0 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Fri Aug 12 11:33:41 2011 +0100 +++ b/xen/arch/x86/irq.c Tue Aug 16 15:14:19 2011 +0100 @@ -1869,8 +1869,14 @@ int hvm_domain_use_pirq(struct domain *d, int pirq) { + int emuirq; + if ( !is_hvm_domain(d) || pirq < 0 ) return 0; - return (domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND); + emuirq = domain_pirq_to_emuirq(d, pirq); + if ( emuirq != IRQ_UNBOUND && d->pirq_to_evtchn[pirq] != 0 ) + return 1; + else + return 0; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 16 22:02:17 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 16 Aug 2011 22:02:17 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYGe-0004Bm-UF; Tue, 16 Aug 2011 22:02:17 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYEr-00045h-7G for xen-changelog@lists.xensource.com; Tue, 16 Aug 2011 22:00:47 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QtYEq-0006PV-GO for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 06:00:24 +0100 Message-Id: Date: Wed, 17 Aug 2011 06:00:24 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] x86: IRQ fix incorrect logic in __clear_irq_vector X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Andrew Cooper # Date 1313504263 -3600 # Node ID 4797cf4823558e8af9cf80e18fa166c8411ea62f # Parent d52e686e0e2f0cde9a53b83163888ade94376376 x86: IRQ fix incorrect logic in __clear_irq_vector In the old code, tmp_mask is the cpu_and of cfg->cpu_mask and cpu_online_map. However, in the usual case of moving an IRQ from one PCPU to another because the scheduler decides its a good idea, cfg->cpu_mask and cfg->old_cpu_mask do not intersect. This causes the old cpu vector_irq table to keep the irq reference when it shouldn't. This leads to a resource leak if a domain is shut down wile an irq has a move pending, which results in Xen's create_irq() eventually failing with -ENOSPC when all vector_irq tables are full of stale references. Signed-off-by: Andrew Cooper xen-unstable changeset: 23765:68b903bb1b01 xen-unstable date: Sat Aug 13 10:14:28 2011 +0100 --- diff -r d52e686e0e2f -r 4797cf482355 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Tue Aug 16 15:17:06 2011 +0100 +++ b/xen/arch/x86/irq.c Tue Aug 16 15:17:43 2011 +0100 @@ -190,6 +190,7 @@ if (likely(!cfg->move_in_progress)) return; + cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map); for_each_cpu_mask(cpu, tmp_mask) { for (vector = FIRST_DYNAMIC_VECTOR; vector <= LAST_DYNAMIC_VECTOR; vector++) { _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 16 22:02:49 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 16 Aug 2011 22:02:49 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYHA-0004Fb-0Q; Tue, 16 Aug 2011 22:02:48 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYEq-00045g-Oy for xen-changelog@lists.xensource.com; Tue, 16 Aug 2011 22:00:47 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QtYEq-0006PG-1c for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 06:00:24 +0100 Message-Id: Date: Wed, 17 Aug 2011 06:00:23 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] VT-d: don't reject valid DMAR/ATSR tables on systems with multiple PCI segments X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313504226 -3600 # Node ID d52e686e0e2f0cde9a53b83163888ade94376376 # Parent c8987be040d03acf69b068379ba063c446ce97ac VT-d: don't reject valid DMAR/ATSR tables on systems with multiple PCI segments On multi-PCI-segment systems, each segment has to be expected to have an include-all DRHD and an all-ports ATSR, so the firmware consistency check incorrectly rejects valid configurations there (which is particularly problematic when the firmware also pre-enabled x2apic mode, as the system will panic in that case due to being unable to enable interrupt remapping). Thus constrain the check to just segment 0 for now; once full multi-segment support is there (which I'm working on), it can be revisited whether we'd want to track this per segment, or whether we trust the firmware of such large systems. Signed-off-by: Jan Beulich xen-unstable changeset: 23763:8f647d409196 xen-unstable date: Sat Aug 13 10:12:49 2011 +0100 --- diff -r c8987be040d0 -r d52e686e0e2f xen/drivers/passthrough/vtd/dmar.c --- a/xen/drivers/passthrough/vtd/dmar.c Tue Aug 16 15:14:19 2011 +0100 +++ b/xen/drivers/passthrough/vtd/dmar.c Tue Aug 16 15:17:06 2011 +0100 @@ -426,13 +426,14 @@ if ( iommu_verbose ) dprintk(VTDPREFIX, " flags: INCLUDE_ALL\n"); /* Only allow one INCLUDE_ALL */ - if ( include_all ) + if ( drhd->segment == 0 && include_all ) { dprintk(XENLOG_WARNING VTDPREFIX, "Only one INCLUDE_ALL device scope is allowed\n"); ret = -EINVAL; } - include_all = 1; + if ( drhd->segment == 0 ) + include_all = 1; } if ( ret ) @@ -632,13 +633,14 @@ if ( iommu_verbose ) dprintk(VTDPREFIX, " flags: ALL_PORTS\n"); /* Only allow one ALL_PORTS */ - if ( all_ports ) + if ( atsr->segment == 0 && all_ports ) { dprintk(XENLOG_WARNING VTDPREFIX, "Only one ALL_PORTS device scope is allowed\n"); ret = -EINVAL; } - all_ports = 1; + if ( atsr->segment == 0 ) + all_ports = 1; } if ( ret ) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 16 22:03:06 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 16 Aug 2011 22:03:06 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYHS-0004JG-E7; Tue, 16 Aug 2011 22:03:06 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QtYEr-00045j-Mo for xen-changelog@lists.xensource.com; Tue, 16 Aug 2011 22:00:48 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QtYEq-0006Pm-Vk for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 06:00:24 +0100 Message-Id: Date: Wed, 17 Aug 2011 06:00:24 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] x86/PCI-MSI: properly determine VF BAR values X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313504506 -3600 # Node ID 98c98daab56afa001e966c803f242439645a23d0 # Parent 4797cf4823558e8af9cf80e18fa166c8411ea62f x86/PCI-MSI: properly determine VF BAR values As was discussed a couple of times on this list, SR-IOV virtual functions have their BARs read as zero - the physical function's SR-IOV capability structure must be consulted instead. The bogus warnings people complained about are being eliminated with this change. Signed-off-by: Jan Beulich xen-unstable changeset: 23766:8d6edc3d26d2 xen-unstable date: Sat Aug 13 10:14:58 2011 +0100 PCI: consolidate interface for adding devices The functionality of pci_add_device_ext() can be easily folded into pci_add_device(), and eliminates the need to change two functions for future adjustments. Signed-off-by: Jan Beulich xen-unstable changeset: 23725:4dc6a9ba90d6 xen-unstable date: Tue Jul 19 14:14:08 2011 +0100 --- diff -r 4797cf482355 -r 98c98daab56a xen/arch/ia64/xen/hypercall.c --- a/xen/arch/ia64/xen/hypercall.c Tue Aug 16 15:17:43 2011 +0100 +++ b/xen/arch/ia64/xen/hypercall.c Tue Aug 16 15:21:46 2011 +0100 @@ -662,8 +662,8 @@ if ( copy_from_guest(&manage_pci, arg, 1) != 0 ) break; - ret = pci_add_device(manage_pci.bus, manage_pci.devfn); - break; + ret = pci_add_device(manage_pci.bus, manage_pci.devfn, NULL); + break; } case PHYSDEVOP_manage_pci_remove: { @@ -695,10 +695,10 @@ pdev_info.is_virtfn = manage_pci_ext.is_virtfn; pdev_info.physfn.bus = manage_pci_ext.physfn.bus; pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn; - ret = pci_add_device_ext(manage_pci_ext.bus, - manage_pci_ext.devfn, - &pdev_info); - break; + ret = pci_add_device(manage_pci_ext.bus, + manage_pci_ext.devfn, + &pdev_info); + break; } default: diff -r 4797cf482355 -r 98c98daab56a xen/arch/x86/msi.c --- a/xen/arch/x86/msi.c Tue Aug 16 15:17:43 2011 +0100 +++ b/xen/arch/x86/msi.c Tue Aug 16 15:21:46 2011 +0100 @@ -521,12 +521,48 @@ return 0; } -static u64 read_pci_mem_bar(u8 bus, u8 slot, u8 func, u8 bir) +static u64 read_pci_mem_bar(u8 bus, u8 slot, u8 func, u8 bir, int vf) { u8 limit; - u32 addr; + u32 addr, base = PCI_BASE_ADDRESS_0, disp = 0; - switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) & 0x7f ) + if ( vf >= 0 ) + { + struct pci_dev *pdev = pci_get_pdev(bus, PCI_DEVFN(slot, func)); + unsigned int pos = pci_find_ext_capability(0, bus, + PCI_DEVFN(slot, func), + PCI_EXT_CAP_ID_SRIOV); + u16 ctrl = pci_conf_read16(bus, slot, func, pos + PCI_SRIOV_CTRL); + u16 num_vf = pci_conf_read16(bus, slot, func, pos + PCI_SRIOV_NUM_VF); + u16 offset = pci_conf_read16(bus, slot, func, + pos + PCI_SRIOV_VF_OFFSET); + u16 stride = pci_conf_read16(bus, slot, func, + pos + PCI_SRIOV_VF_STRIDE); + + if ( !pdev || !pos || + !(ctrl & PCI_SRIOV_CTRL_VFE) || + !(ctrl & PCI_SRIOV_CTRL_MSE) || + !num_vf || !offset || (num_vf > 1 && !stride) || + bir >= PCI_SRIOV_NUM_BARS || + !pdev->vf_rlen[bir] ) + return 0; + base = pos + PCI_SRIOV_BAR; + vf -= PCI_BDF(bus, slot, func) + offset; + if ( vf < 0 || (vf && vf % stride) ) + return 0; + if ( stride ) + { + if ( vf % stride ) + return 0; + vf /= stride; + } + if ( vf >= num_vf ) + return 0; + BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS); + disp = vf * pdev->vf_rlen[bir]; + limit = PCI_SRIOV_NUM_BARS; + } + else switch ( pci_conf_read8(bus, slot, func, PCI_HEADER_TYPE) & 0x7f ) { case PCI_HEADER_TYPE_NORMAL: limit = 6; @@ -543,7 +579,7 @@ if ( bir >= limit ) return 0; - addr = pci_conf_read32(bus, slot, func, PCI_BASE_ADDRESS_0 + bir * 4); + addr = pci_conf_read32(bus, slot, func, base + bir * 4); if ( (addr & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO ) return 0; if ( (addr & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64 ) @@ -551,11 +587,10 @@ addr &= PCI_BASE_ADDRESS_MEM_MASK; if ( ++bir >= limit ) return 0; - return addr | - ((u64)pci_conf_read32(bus, slot, func, - PCI_BASE_ADDRESS_0 + bir * 4) << 32); + return addr + disp + + ((u64)pci_conf_read32(bus, slot, func, base + bir * 4) << 32); } - return addr & PCI_BASE_ADDRESS_MEM_MASK; + return (addr & PCI_BASE_ADDRESS_MEM_MASK) + disp; } /** @@ -628,11 +663,29 @@ if ( !dev->msix_nr_entries ) { + u8 pbus, pslot, pfunc; + int vf; u64 pba_paddr; u32 pba_offset; + if ( !dev->info.is_virtfn ) + { + pbus = bus; + pslot = slot; + pfunc = func; + vf = -1; + } + else + { + pbus = dev->info.physfn.bus; + pslot = PCI_SLOT(dev->info.physfn.devfn); + pfunc = PCI_FUNC(dev->info.physfn.devfn); + vf = PCI_BDF2(dev->bus, dev->devfn); + } + ASSERT(!dev->msix_used_entries); - WARN_ON(msi->table_base != read_pci_mem_bar(bus, slot, func, bir)); + WARN_ON(msi->table_base != + read_pci_mem_bar(pbus, pslot, pfunc, bir, vf)); dev->msix_nr_entries = nr_entries; dev->msix_table.first = PFN_DOWN(table_paddr); @@ -644,7 +697,7 @@ pba_offset = pci_conf_read32(bus, slot, func, msix_pba_offset_reg(pos)); bir = (u8)(pba_offset & PCI_MSIX_BIRMASK); - pba_paddr = read_pci_mem_bar(bus, slot, func, bir); + pba_paddr = read_pci_mem_bar(pbus, pslot, pfunc, bir, vf); WARN_ON(!pba_paddr); pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK; diff -r 4797cf482355 -r 98c98daab56a xen/arch/x86/physdev.c --- a/xen/arch/x86/physdev.c Tue Aug 16 15:17:43 2011 +0100 +++ b/xen/arch/x86/physdev.c Tue Aug 16 15:21:46 2011 +0100 @@ -472,7 +472,7 @@ if ( copy_from_guest(&manage_pci, arg, 1) != 0 ) break; - ret = pci_add_device(manage_pci.bus, manage_pci.devfn); + ret = pci_add_device(manage_pci.bus, manage_pci.devfn, NULL); break; } @@ -509,9 +509,9 @@ pdev_info.is_virtfn = manage_pci_ext.is_virtfn; pdev_info.physfn.bus = manage_pci_ext.physfn.bus; pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn; - ret = pci_add_device_ext(manage_pci_ext.bus, - manage_pci_ext.devfn, - &pdev_info); + ret = pci_add_device(manage_pci_ext.bus, + manage_pci_ext.devfn, + &pdev_info); break; } diff -r 4797cf482355 -r 98c98daab56a xen/drivers/passthrough/pci.c --- a/xen/drivers/passthrough/pci.c Tue Aug 16 15:17:43 2011 +0100 +++ b/xen/drivers/passthrough/pci.c Tue Aug 16 15:21:46 2011 +0100 @@ -142,16 +142,101 @@ pci_conf_write16(bus, dev, func, pos + PCI_ACS_CTRL, ctrl); } -int pci_add_device(u8 bus, u8 devfn) +int pci_add_device(u8 bus, u8 devfn, const struct pci_dev_info *info) { struct pci_dev *pdev; + unsigned int slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn); + const char *pdev_type; int ret = -ENOMEM; + if (!info) + pdev_type = "device"; + else if (info->is_extfn) + pdev_type = "extended function"; + else if (info->is_virtfn) + { + spin_lock(&pcidevs_lock); + pdev = pci_get_pdev(info->physfn.bus, info->physfn.devfn); + spin_unlock(&pcidevs_lock); + if ( !pdev ) + pci_add_device(info->physfn.bus, info->physfn.devfn, NULL); + pdev_type = "virtual function"; + } + else + return -EINVAL; + spin_lock(&pcidevs_lock); pdev = alloc_pdev(bus, devfn); if ( !pdev ) goto out; + if ( info ) + pdev->info = *info; + else if ( !pdev->vf_rlen[0] ) + { + unsigned int pos = pci_find_ext_capability(0, bus, devfn, + PCI_EXT_CAP_ID_SRIOV); + u16 ctrl = pci_conf_read16(bus, slot, func, pos + PCI_SRIOV_CTRL); + + if ( !pos ) + /* Nothing */; + else if ( !(ctrl & (PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE)) ) + { + unsigned int i; + + BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS); + for ( i = 0; i < PCI_SRIOV_NUM_BARS; ++i ) + { + unsigned int idx = pos + PCI_SRIOV_BAR + i * 4; + u32 bar = pci_conf_read32(bus, slot, func, idx); + u32 hi = 0; + + if ( (bar & PCI_BASE_ADDRESS_SPACE) == + PCI_BASE_ADDRESS_SPACE_IO ) + { + printk(XENLOG_WARNING "SR-IOV device %02x:%02x.%x with vf" + " BAR%u in IO space\n", + bus, slot, func, i); + continue; + } + pci_conf_write32(bus, slot, func, idx, ~0); + if ( (bar & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == + PCI_BASE_ADDRESS_MEM_TYPE_64 ) + { + if ( i >= PCI_SRIOV_NUM_BARS ) + { + printk(XENLOG_WARNING "SR-IOV device %02x:%02x.%x with" + " 64-bit vf BAR in last slot\n", + bus, slot, func); + break; + } + hi = pci_conf_read32(bus, slot, func, idx + 4); + pci_conf_write32(bus, slot, func, idx + 4, ~0); + } + pdev->vf_rlen[i] = pci_conf_read32(bus, slot, func, idx) & + PCI_BASE_ADDRESS_MEM_MASK; + if ( (bar & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == + PCI_BASE_ADDRESS_MEM_TYPE_64 ) + { + pdev->vf_rlen[i] |= (u64)pci_conf_read32(bus, slot, func, + idx + 4) << 32; + pci_conf_write32(bus, slot, func, idx + 4, hi); + } + else if ( pdev->vf_rlen[i] ) + pdev->vf_rlen[i] |= (u64)~0 << 32; + pci_conf_write32(bus, slot, func, idx, bar); + pdev->vf_rlen[i] = -pdev->vf_rlen[i]; + if ( (bar & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == + PCI_BASE_ADDRESS_MEM_TYPE_64 ) + ++i; + } + } + else + printk(XENLOG_WARNING "SR-IOV device %02x:%02x.%x has its virtual" + " functions already enabled (%04x)\n", + bus, slot, func, ctrl); + } + ret = 0; if ( !pdev->domain ) { @@ -169,8 +254,8 @@ out: spin_unlock(&pcidevs_lock); - printk(XENLOG_DEBUG "PCI add device %02x:%02x.%x\n", bus, - PCI_SLOT(devfn), PCI_FUNC(devfn)); + printk(XENLOG_DEBUG "PCI add %s %02x:%02x.%x\n", pdev_type, + bus, slot, func); return ret; } @@ -197,51 +282,6 @@ return ret; } -int pci_add_device_ext(u8 bus, u8 devfn, struct pci_dev_info *info) -{ - int ret; - char *pdev_type; - struct pci_dev *pdev; - - if (info->is_extfn) - pdev_type = "Extended Function"; - else if (info->is_virtfn) - pdev_type = "Virtual Function"; - else - return -EINVAL; - - - ret = -ENOMEM; - spin_lock(&pcidevs_lock); - pdev = alloc_pdev(bus, devfn); - if ( !pdev ) - goto out; - - pdev->info = *info; - - ret = 0; - if ( !pdev->domain ) - { - pdev->domain = dom0; - ret = iommu_add_device(pdev); - if ( ret ) - { - pdev->domain = NULL; - goto out; - } - - list_add(&pdev->domain_list, &dom0->arch.pdev_list); - pci_enable_acs(pdev); - } - -out: - spin_unlock(&pcidevs_lock); - printk(XENLOG_DEBUG "PCI add %s %02x:%02x.%x\n", pdev_type, - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); - - return ret; -} - static void pci_clean_dpci_irqs(struct domain *d) { struct hvm_irq_dpci *hvm_irq_dpci = NULL; diff -r 4797cf482355 -r 98c98daab56a xen/include/xen/pci.h --- a/xen/include/xen/pci.h Tue Aug 16 15:17:43 2011 +0100 +++ b/xen/include/xen/pci.h Tue Aug 16 15:21:46 2011 +0100 @@ -57,6 +57,7 @@ const u8 bus; const u8 devfn; struct pci_dev_info info; + u64 vf_rlen[6]; }; #define for_each_pdev(domain, pdev) \ @@ -86,9 +87,8 @@ struct pci_dev *pci_lock_domain_pdev(struct domain *d, int bus, int devfn); void pci_release_devices(struct domain *d); -int pci_add_device(u8 bus, u8 devfn); +int pci_add_device(u8 bus, u8 devfn, const struct pci_dev_info *); int pci_remove_device(u8 bus, u8 devfn); -int pci_add_device_ext(u8 bus, u8 devfn, struct pci_dev_info *info); struct pci_dev *pci_get_pdev(int bus, int devfn); struct pci_dev *pci_get_pdev_by_domain(struct domain *d, int bus, int devfn); diff -r 4797cf482355 -r 98c98daab56a xen/include/xen/pci_regs.h --- a/xen/include/xen/pci_regs.h Tue Aug 16 15:17:43 2011 +0100 +++ b/xen/include/xen/pci_regs.h Tue Aug 16 15:21:46 2011 +0100 @@ -425,7 +425,7 @@ #define PCI_EXT_CAP_ID_ACS 13 #define PCI_EXT_CAP_ID_ARI 14 #define PCI_EXT_CAP_ID_ATS 15 -#define PCI_EXT_CAP_ID_IOV 16 +#define PCI_EXT_CAP_ID_SRIOV 16 /* Advanced Error Reporting */ #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ @@ -545,4 +545,35 @@ #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ +/* Single Root I/O Virtualization */ +#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ +#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ +#define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */ +#define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */ +#define PCI_SRIOV_CTRL_VFE 0x01 /* VF Enable */ +#define PCI_SRIOV_CTRL_VFM 0x02 /* VF Migration Enable */ +#define PCI_SRIOV_CTRL_INTR 0x04 /* VF Migration Interrupt Enable */ +#define PCI_SRIOV_CTRL_MSE 0x08 /* VF Memory Space Enable */ +#define PCI_SRIOV_CTRL_ARI 0x10 /* ARI Capable Hierarchy */ +#define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */ +#define PCI_SRIOV_STATUS_VFM 0x01 /* VF Migration Status */ +#define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */ +#define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */ +#define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */ +#define PCI_SRIOV_FUNC_LINK 0x12 /* Function Dependency Link */ +#define PCI_SRIOV_VF_OFFSET 0x14 /* First VF Offset */ +#define PCI_SRIOV_VF_STRIDE 0x16 /* Following VF Stride */ +#define PCI_SRIOV_VF_DID 0x1a /* VF Device ID */ +#define PCI_SRIOV_SUP_PGSIZE 0x1c /* Supported Page Sizes */ +#define PCI_SRIOV_SYS_PGSIZE 0x20 /* System Page Size */ +#define PCI_SRIOV_BAR 0x24 /* VF BAR0 */ +#define PCI_SRIOV_NUM_BARS 6 /* Number of VF BARs */ +#define PCI_SRIOV_VFM 0x3c /* VF Migration State Array Offset*/ +#define PCI_SRIOV_VFM_BIR(x) ((x) & 7) /* State BIR */ +#define PCI_SRIOV_VFM_OFFSET(x) ((x) & ~7) /* State Offset */ +#define PCI_SRIOV_VFM_UA 0x0 /* Inactive.Unavailable */ +#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ +#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ +#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ + #endif /* LINUX_PCI_REGS_H */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 17 08:22:15 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 17 Aug 2011 08:22:15 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qthwd-0002it-7C; Wed, 17 Aug 2011 08:22:15 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QthwY-0002hU-S4 for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 08:22:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QthwY-0004Ss-1S for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 16:22:10 +0100 Message-Id: Date: Wed, 17 Aug 2011 16:22:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Revert 23733:fbf3768e5934 "AMD IOMMU: remove global ..." X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Ian Jackson # Date 1313503459 -3600 # Node ID 09595fdf36381a9587841fe7dfe1cc82564f0f02 # Parent 80e9fcdaef3673ca1294ceb4da3e49dda32ca318 Revert 23733:fbf3768e5934 "AMD IOMMU: remove global ..." 23733:fbf3768e5934 causes xen-unstable not to boot on several of the xen.org AMD test systems. We get an endless series of these: (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 0, device id = 0x00a0, fault address = 0xfdf8f10144 I have constructed the attached patch which reverts c/s 23733 (adjusted for conflicts due to subsequent patches). With this reversion Xen once more boots on these machines. 23733 has been in the tree for some time now, causing this breakage, and has already been fingered by the automatic bisector and discussed on xen-devel as the cause of boot failures. I think it is now time to revert it pending a correct fix to the original problem. Signed-off-by: Ian Jackson --- diff -r 80e9fcdaef36 -r 09595fdf3638 xen/drivers/passthrough/amd/iommu_acpi.c --- a/xen/drivers/passthrough/amd/iommu_acpi.c Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_acpi.c Tue Aug 16 15:04:19 2011 +0100 @@ -66,8 +66,15 @@ if (ivrs_mappings[alias_id].intremap_table == NULL ) { /* allocate per-device interrupt remapping table */ - ivrs_mappings[alias_id].intremap_table = + if ( amd_iommu_perdev_intremap ) + ivrs_mappings[alias_id].intremap_table = amd_iommu_alloc_intremap_table(); + else + { + if ( shared_intremap_table == NULL ) + shared_intremap_table = amd_iommu_alloc_intremap_table(); + ivrs_mappings[alias_id].intremap_table = shared_intremap_table; + } } /* assgin iommu hardware */ ivrs_mappings[bdf].iommu = iommu; diff -r 80e9fcdaef36 -r 09595fdf3638 xen/drivers/passthrough/amd/iommu_init.c --- a/xen/drivers/passthrough/amd/iommu_init.c Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_init.c Tue Aug 16 15:04:19 2011 +0100 @@ -500,7 +500,7 @@ /* Tell the device to stop DMAing; we can't rely on the guest to * control it for us. */ for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ ) - if ( get_requestor_id(bdf) == device_id ) + if ( get_dma_requestor_id(bdf) == device_id ) { cword = pci_conf_read16(PCI_BUS(bdf), PCI_SLOT(bdf), PCI_FUNC(bdf), PCI_COMMAND); @@ -772,7 +772,8 @@ ivrs_mappings[bdf].dte_ext_int_pass = IOMMU_CONTROL_DISABLED; ivrs_mappings[bdf].dte_init_pass = IOMMU_CONTROL_DISABLED; - spin_lock_init(&ivrs_mappings[bdf].intremap_lock); + if ( amd_iommu_perdev_intremap ) + spin_lock_init(&ivrs_mappings[bdf].intremap_lock); } return 0; } diff -r 80e9fcdaef36 -r 09595fdf3638 xen/drivers/passthrough/amd/iommu_intr.c --- a/xen/drivers/passthrough/amd/iommu_intr.c Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_intr.c Tue Aug 16 15:04:19 2011 +0100 @@ -28,10 +28,20 @@ #define INTREMAP_ENTRIES (1 << INTREMAP_LENGTH) int ioapic_bdf[MAX_IO_APICS]; +void *shared_intremap_table; +static DEFINE_SPINLOCK(shared_intremap_lock); static spinlock_t* get_intremap_lock(int req_id) { - return &ivrs_mappings[req_id].intremap_lock; + return (amd_iommu_perdev_intremap ? + &ivrs_mappings[req_id].intremap_lock: + &shared_intremap_lock); +} + +static int get_intremap_requestor_id(int bdf) +{ + ASSERT( bdf < ivrs_bdf_entries ); + return ivrs_mappings[bdf].dte_requestor_id; } static int get_intremap_offset(u8 vector, u8 dm) @@ -115,7 +125,7 @@ spinlock_t *lock; int offset; - req_id = get_requestor_id(bdf); + req_id = get_intremap_requestor_id(bdf); lock = get_intremap_lock(req_id); delivery_mode = rte->delivery_mode; @@ -173,7 +183,7 @@ continue; } - req_id = get_requestor_id(bdf); + req_id = get_intremap_requestor_id(bdf); lock = get_intremap_lock(req_id); delivery_mode = rte.delivery_mode; @@ -273,13 +283,14 @@ { unsigned long flags; u32* entry; - u16 bdf, req_id; + u16 bdf, req_id, alias_id; u8 delivery_mode, dest, vector, dest_mode; spinlock_t *lock; int offset; bdf = (pdev->bus << 8) | pdev->devfn; - req_id = get_requestor_id(bdf); + req_id = get_dma_requestor_id(bdf); + alias_id = get_intremap_requestor_id(bdf); if ( msg == NULL ) { @@ -288,6 +299,14 @@ free_intremap_entry(req_id, msi_desc->remap_index); spin_unlock_irqrestore(lock, flags); + if ( ( req_id != alias_id ) && + ivrs_mappings[alias_id].intremap_table != NULL ) + { + lock = get_intremap_lock(alias_id); + spin_lock_irqsave(lock, flags); + free_intremap_entry(alias_id, msi_desc->remap_index); + spin_unlock_irqrestore(lock, flags); + } goto done; } @@ -305,11 +324,30 @@ update_intremap_entry(entry, vector, delivery_mode, dest_mode, dest); spin_unlock_irqrestore(lock, flags); + /* + * In some special cases, a pci-e device(e.g SATA controller in IDE mode) + * will use alias id to index interrupt remapping table. + * We have to setup a secondary interrupt remapping entry to satisfy those + * devices. + */ + + lock = get_intremap_lock(alias_id); + if ( ( req_id != alias_id ) && + ivrs_mappings[alias_id].intremap_table != NULL ) + { + spin_lock_irqsave(lock, flags); + entry = (u32*)get_intremap_entry(alias_id, offset); + update_intremap_entry(entry, vector, delivery_mode, dest_mode, dest); + spin_unlock_irqrestore(lock, flags); + } + done: if ( iommu->enabled ) { spin_lock_irqsave(&iommu->lock, flags); invalidate_interrupt_table(iommu, req_id); + if ( alias_id != req_id ) + invalidate_interrupt_table(iommu, alias_id); flush_command_buffer(iommu); spin_unlock_irqrestore(&iommu->lock, flags); } diff -r 80e9fcdaef36 -r 09595fdf3638 xen/drivers/passthrough/amd/iommu_map.c --- a/xen/drivers/passthrough/amd/iommu_map.c Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_map.c Tue Aug 16 15:04:19 2011 +0100 @@ -719,7 +719,7 @@ for_each_pdev( d, pdev ) { bdf = (pdev->bus << 8) | pdev->devfn; - req_id = get_requestor_id(bdf); + req_id = get_dma_requestor_id(bdf); iommu = find_iommu_for_device(bdf); if ( !iommu ) { diff -r 80e9fcdaef36 -r 09595fdf3638 xen/drivers/passthrough/amd/pci_amd_iommu.c --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Aug 16 15:04:19 2011 +0100 @@ -34,10 +34,25 @@ return ivrs_mappings[bdf].iommu; } -int get_requestor_id(u16 bdf) +/* + * Some devices will use alias id and original device id to index interrupt + * table and I/O page table respectively. Such devices will have + * both alias entry and select entry in IVRS structure. + * + * Return original device id, if device has valid interrupt remapping + * table setup for both select entry and alias entry. + */ +int get_dma_requestor_id(u16 bdf) { + int req_id; + BUG_ON ( bdf >= ivrs_bdf_entries ); - return ivrs_mappings[bdf].dte_requestor_id; + req_id = ivrs_mappings[bdf].dte_requestor_id; + if ( (ivrs_mappings[bdf].intremap_table != NULL) && + (ivrs_mappings[req_id].intremap_table != NULL) ) + req_id = bdf; + + return req_id; } static int is_translation_valid(u32 *entry) @@ -79,7 +94,7 @@ valid = 0; /* get device-table entry */ - req_id = get_requestor_id(bdf); + req_id = get_dma_requestor_id(bdf); dte = iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE); spin_lock_irqsave(&iommu->lock, flags); @@ -254,7 +269,7 @@ int req_id; BUG_ON ( iommu->dev_table.buffer == NULL ); - req_id = get_requestor_id(bdf); + req_id = get_dma_requestor_id(bdf); dte = iommu->dev_table.buffer + (req_id * IOMMU_DEV_TABLE_ENTRY_SIZE); spin_lock_irqsave(&iommu->lock, flags); @@ -316,7 +331,7 @@ static int amd_iommu_assign_device(struct domain *d, u8 bus, u8 devfn) { int bdf = (bus << 8) | devfn; - int req_id = get_requestor_id(bdf); + int req_id = get_dma_requestor_id(bdf); if ( ivrs_mappings[req_id].unity_map_enable ) { @@ -447,7 +462,7 @@ int rt; int bdf = (bus << 8) | devfn; rt = ( bdf < ivrs_bdf_entries ) ? - get_requestor_id(bdf) : + get_dma_requestor_id(bdf) : bdf; return rt; } diff -r 80e9fcdaef36 -r 09595fdf3638 xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Tue Aug 16 15:04:19 2011 +0100 @@ -50,6 +50,7 @@ bool_t __read_mostly iommu_hap_pt_share; bool_t __read_mostly iommu_debug; bool_t __read_mostly iommu_amd_perdev_vector_map = 1; +bool_t __read_mostly amd_iommu_perdev_intremap; static void __init parse_iommu_param(char *s) { @@ -76,6 +77,8 @@ iommu_intremap = 0; else if ( !strcmp(s, "debug") ) iommu_debug = 1; + else if ( !strcmp(s, "amd-iommu-perdev-intremap") ) + amd_iommu_perdev_intremap = 1; else if ( !strcmp(s, "dom0-passthrough") ) iommu_passthrough = 1; else if ( !strcmp(s, "dom0-strict") ) diff -r 80e9fcdaef36 -r 09595fdf3638 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h --- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h Tue Aug 16 15:04:19 2011 +0100 @@ -65,7 +65,7 @@ void amd_iommu_share_p2m(struct domain *d); /* device table functions */ -int get_requestor_id(u16 bdf); +int get_dma_requestor_id(u16 bdf); void amd_iommu_add_dev_table_entry( u32 *dte, u8 sys_mgt, u8 dev_ex, u8 lint1_pass, u8 lint0_pass, u8 nmi_pass, u8 ext_int_pass, u8 init_pass); @@ -97,6 +97,7 @@ unsigned int apic, unsigned int reg); extern int ioapic_bdf[MAX_IO_APICS]; +extern void *shared_intremap_table; /* power management support */ void amd_iommu_resume(void); diff -r 80e9fcdaef36 -r 09595fdf3638 xen/include/xen/iommu.h --- a/xen/include/xen/iommu.h Tue Aug 16 15:03:11 2011 +0100 +++ b/xen/include/xen/iommu.h Tue Aug 16 15:04:19 2011 +0100 @@ -32,6 +32,7 @@ extern bool_t iommu_snoop, iommu_qinval, iommu_intremap; extern bool_t iommu_hap_pt_share; extern bool_t iommu_debug; +extern bool_t amd_iommu_perdev_intremap; extern struct rangeset *mmio_ro_ranges; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 17 08:22:22 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 17 Aug 2011 08:22:22 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qthwj-0002mC-Q6; Wed, 17 Aug 2011 08:22:21 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QthwY-0002hR-Of for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 08:22:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QthwX-0004Rc-D0 for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 16:22:09 +0100 Message-Id: Date: Wed, 17 Aug 2011 16:22:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] amd iommu: Automatic page coalescing X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Wei Wang # Date 1313503391 -3600 # Node ID 80e9fcdaef3673ca1294ceb4da3e49dda32ca318 # Parent 8d6edc3d26d26931f3732a2008fb4818bc7bab2d amd iommu: Automatic page coalescing This patch implements automatic page coalescing when separated io page table is used. It uses ignore bits in iommu pde to cache how many entries lower next page level are suitable for coalescing and then builds a super page entry when all lower entries are contiguous. This patch has been tested OK for weeks mainly with graphic devices and 3D mark vantage. Signed-off-by: Wei Wang --- diff -r 8d6edc3d26d2 -r 80e9fcdaef36 xen/drivers/passthrough/amd/iommu_map.c --- a/xen/drivers/passthrough/amd/iommu_map.c Sat Aug 13 10:14:58 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_map.c Tue Aug 16 15:03:11 2011 +0100 @@ -168,98 +168,59 @@ AMD_IOMMU_DEBUG("Warning: ComWaitInt bit did not assert!\n"); } -static void clear_iommu_l1e_present(u64 l2e, unsigned long gfn) +/* Given pfn and page table level, return pde index */ +static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level) { - u32 *l1e; - int offset; - void *l1_table; + unsigned int idx; - l1_table = map_domain_page(l2e >> PAGE_SHIFT); - - offset = gfn & (~PTE_PER_TABLE_MASK); - l1e = (u32*)(l1_table + (offset * IOMMU_PAGE_TABLE_ENTRY_SIZE)); - - /* clear l1 entry */ - l1e[0] = l1e[1] = 0; - - unmap_domain_page(l1_table); + idx = pfn >> (PTE_PER_TABLE_SHIFT * (--level)); + idx &= ~PTE_PER_TABLE_MASK; + return idx; } -static int set_iommu_l1e_present(u64 l2e, unsigned long gfn, - u64 maddr, int iw, int ir) +void clear_iommu_pte_present(unsigned long l1_mfn, unsigned long gfn) { - u64 addr_lo, addr_hi, maddr_old; + u64 *table, *pte; + + table = map_domain_page(l1_mfn); + pte = table + pfn_to_pde_idx(gfn, IOMMU_PAGING_MODE_LEVEL_1); + *pte = 0; + unmap_domain_page(table); +} + +static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn, + unsigned int next_level, + bool_t iw, bool_t ir) +{ + u64 addr_lo, addr_hi, maddr_old, maddr_next; u32 entry; - void *l1_table; - int offset; - u32 *l1e; - int need_flush = 0; + bool_t need_flush = 0; - l1_table = map_domain_page(l2e >> PAGE_SHIFT); + maddr_next = (u64)next_mfn << PAGE_SHIFT; - offset = gfn & (~PTE_PER_TABLE_MASK); - l1e = (u32*)((u8*)l1_table + (offset * IOMMU_PAGE_TABLE_ENTRY_SIZE)); - - addr_hi = get_field_from_reg_u32(l1e[1], + addr_hi = get_field_from_reg_u32(pde[1], IOMMU_PTE_ADDR_HIGH_MASK, IOMMU_PTE_ADDR_HIGH_SHIFT); - addr_lo = get_field_from_reg_u32(l1e[0], + addr_lo = get_field_from_reg_u32(pde[0], IOMMU_PTE_ADDR_LOW_MASK, IOMMU_PTE_ADDR_LOW_SHIFT); - maddr_old = ((addr_hi << 32) | addr_lo) << PAGE_SHIFT; + maddr_old = (addr_hi << 32) | (addr_lo << PAGE_SHIFT); - if ( maddr_old && (maddr_old != maddr) ) + if ( maddr_old != maddr_next ) need_flush = 1; - addr_lo = maddr & DMA_32BIT_MASK; - addr_hi = maddr >> 32; - - set_field_in_reg_u32((u32)addr_hi, 0, - IOMMU_PTE_ADDR_HIGH_MASK, - IOMMU_PTE_ADDR_HIGH_SHIFT, &entry); - set_field_in_reg_u32(iw ? IOMMU_CONTROL_ENABLED : - IOMMU_CONTROL_DISABLED, entry, - IOMMU_PTE_IO_WRITE_PERMISSION_MASK, - IOMMU_PTE_IO_WRITE_PERMISSION_SHIFT, &entry); - set_field_in_reg_u32(ir ? IOMMU_CONTROL_ENABLED : - IOMMU_CONTROL_DISABLED, entry, - IOMMU_PTE_IO_READ_PERMISSION_MASK, - IOMMU_PTE_IO_READ_PERMISSION_SHIFT, &entry); - l1e[1] = entry; - - set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0, - IOMMU_PTE_ADDR_LOW_MASK, - IOMMU_PTE_ADDR_LOW_SHIFT, &entry); - set_field_in_reg_u32(IOMMU_PAGING_MODE_LEVEL_0, entry, - IOMMU_PTE_NEXT_LEVEL_MASK, - IOMMU_PTE_NEXT_LEVEL_SHIFT, &entry); - set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry, - IOMMU_PTE_PRESENT_MASK, - IOMMU_PTE_PRESENT_SHIFT, &entry); - l1e[0] = entry; - - unmap_domain_page(l1_table); - return need_flush; -} - -static void amd_iommu_set_page_directory_entry(u32 *pde, - u64 next_ptr, u8 next_level) -{ - u64 addr_lo, addr_hi; - u32 entry; - - addr_lo = next_ptr & DMA_32BIT_MASK; - addr_hi = next_ptr >> 32; + addr_lo = maddr_next & DMA_32BIT_MASK; + addr_hi = maddr_next >> 32; /* enable read/write permissions,which will be enforced at the PTE */ set_field_in_reg_u32((u32)addr_hi, 0, IOMMU_PDE_ADDR_HIGH_MASK, IOMMU_PDE_ADDR_HIGH_SHIFT, &entry); - set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry, + set_field_in_reg_u32(iw, entry, IOMMU_PDE_IO_WRITE_PERMISSION_MASK, IOMMU_PDE_IO_WRITE_PERMISSION_SHIFT, &entry); - set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry, + set_field_in_reg_u32(ir, entry, IOMMU_PDE_IO_READ_PERMISSION_MASK, IOMMU_PDE_IO_READ_PERMISSION_SHIFT, &entry); pde[1] = entry; @@ -275,6 +236,26 @@ IOMMU_PDE_PRESENT_MASK, IOMMU_PDE_PRESENT_SHIFT, &entry); pde[0] = entry; + + return need_flush; +} + +static bool_t set_iommu_pte_present(unsigned long pt_mfn, unsigned long gfn, + unsigned long next_mfn, int pde_level, + bool_t iw, bool_t ir) +{ + u64 *table; + u32 *pde; + bool_t need_flush = 0; + + table = map_domain_page(pt_mfn); + + pde = (u32*)(table + pfn_to_pde_idx(gfn, pde_level)); + + need_flush = set_iommu_pde_present(pde, next_mfn, + IOMMU_PAGING_MODE_LEVEL_0, iw, ir); + unmap_domain_page(table); + return need_flush; } void amd_iommu_set_root_page_table( @@ -413,11 +394,18 @@ return ptr; } +static unsigned int iommu_next_level(u32 *entry) +{ + return get_field_from_reg_u32(entry[0], + IOMMU_PDE_NEXT_LEVEL_MASK, + IOMMU_PDE_NEXT_LEVEL_SHIFT); +} + static int amd_iommu_is_pte_present(u32 *entry) { - return (get_field_from_reg_u32(entry[0], - IOMMU_PDE_PRESENT_MASK, - IOMMU_PDE_PRESENT_SHIFT)); + return get_field_from_reg_u32(entry[0], + IOMMU_PDE_PRESENT_MASK, + IOMMU_PDE_PRESENT_SHIFT); } void invalidate_dev_table_entry(struct amd_iommu *iommu, @@ -439,54 +427,241 @@ send_iommu_command(iommu, cmd); } -static u64 iommu_l2e_from_pfn(struct page_info *table, int level, - unsigned long io_pfn) +/* For each pde, We use ignored bits (bit 1 - bit 8 and bit 63) + * to save pde count, pde count = 511 is a candidate of page coalescing. + */ +static unsigned int get_pde_count(u64 pde) { - unsigned long offset; - void *pde = NULL; - void *table_vaddr; - u64 next_table_maddr = 0; - unsigned int lowest = 1; + unsigned int count; + u64 upper_mask = 1ULL << 63 ; + u64 lower_mask = 0xFF << 1; - BUG_ON( table == NULL || level < lowest ); + count = ((pde & upper_mask) >> 55) | ((pde & lower_mask) >> 1); + return count; +} - if ( level == lowest ) - return page_to_maddr(table); +/* Convert pde count into iommu pte ignored bits */ +static void set_pde_count(u64 *pde, unsigned int count) +{ + u64 upper_mask = 1ULL << 8 ; + u64 lower_mask = 0xFF; + u64 pte_mask = (~(1ULL << 63)) & (~(0xFF << 1)); - while ( level > lowest ) + *pde &= pte_mask; + *pde |= ((count & upper_mask ) << 55) | ((count & lower_mask ) << 1); +} + +/* Return 1, if pages are suitable for merging at merge_level. + * otherwise increase pde count if mfn is contigous with mfn - 1 + */ +static int iommu_update_pde_count(struct domain *d, unsigned long pt_mfn, + unsigned long gfn, unsigned long mfn, + unsigned int merge_level) +{ + unsigned int pde_count, next_level; + unsigned long first_mfn; + u64 *table, *pde, *ntable; + u64 ntable_maddr, mask; + struct hvm_iommu *hd = domain_hvm_iommu(d); + bool_t ok = 0; + + ASSERT( spin_is_locked(&hd->mapping_lock) && pt_mfn ); + + next_level = merge_level - 1; + + /* get pde at merge level */ + table = map_domain_page(pt_mfn); + pde = table + pfn_to_pde_idx(gfn, merge_level); + + /* get page table of next level */ + ntable_maddr = amd_iommu_get_next_table_from_pte((u32*)pde); + ntable = map_domain_page(ntable_maddr >> PAGE_SHIFT); + + /* get the first mfn of next level */ + first_mfn = amd_iommu_get_next_table_from_pte((u32*)ntable) >> PAGE_SHIFT; + + if ( first_mfn == 0 ) + goto out; + + mask = (1ULL<< (PTE_PER_TABLE_SHIFT * next_level)) - 1; + + if ( ((first_mfn & mask) == 0) && + (((gfn & mask) | first_mfn) == mfn) ) { - offset = io_pfn >> ((PTE_PER_TABLE_SHIFT * - (level - IOMMU_PAGING_MODE_LEVEL_1))); - offset &= ~PTE_PER_TABLE_MASK; + pde_count = get_pde_count(*pde); - table_vaddr = __map_domain_page(table); - pde = table_vaddr + (offset * IOMMU_PAGE_TABLE_ENTRY_SIZE); - next_table_maddr = amd_iommu_get_next_table_from_pte(pde); + if ( pde_count == (PTE_PER_TABLE_SIZE - 1) ) + ok = 1; + else if ( pde_count < (PTE_PER_TABLE_SIZE - 1)) + { + pde_count++; + set_pde_count(pde, pde_count); + } + } - if ( !amd_iommu_is_pte_present(pde) ) + else + /* non-contiguous mapping */ + set_pde_count(pde, 0); + +out: + unmap_domain_page(ntable); + unmap_domain_page(table); + + return ok; +} + +static int iommu_merge_pages(struct domain *d, unsigned long pt_mfn, + unsigned long gfn, unsigned int flags, + unsigned int merge_level) +{ + u64 *table, *pde, *ntable; + u64 ntable_mfn; + unsigned long first_mfn; + struct hvm_iommu *hd = domain_hvm_iommu(d); + + ASSERT( spin_is_locked(&hd->mapping_lock) && pt_mfn ); + + table = map_domain_page(pt_mfn); + pde = table + pfn_to_pde_idx(gfn, merge_level); + + /* get first mfn */ + ntable_mfn = amd_iommu_get_next_table_from_pte((u32*)pde) >> PAGE_SHIFT; + + if ( ntable_mfn == 0 ) + { + unmap_domain_page(table); + return 1; + } + + ntable = map_domain_page(ntable_mfn); + first_mfn = amd_iommu_get_next_table_from_pte((u32*)ntable) >> PAGE_SHIFT; + + if ( first_mfn == 0 ) + { + unmap_domain_page(ntable); + unmap_domain_page(table); + return 1; + } + + /* setup super page mapping, next level = 0 */ + set_iommu_pde_present((u32*)pde, first_mfn, + IOMMU_PAGING_MODE_LEVEL_0, + !!(flags & IOMMUF_writable), + !!(flags & IOMMUF_readable)); + + amd_iommu_flush_all_pages(d); + + unmap_domain_page(ntable); + unmap_domain_page(table); + return 0; +} + +/* Walk io page tables and build level page tables if necessary + * {Re, un}mapping super page frames causes re-allocation of io + * page tables. + */ +static int iommu_pde_from_gfn(struct domain *d, unsigned long pfn, + unsigned long pt_mfn[]) +{ + u64 *pde, *next_table_vaddr; + unsigned long next_table_mfn; + unsigned int level; + struct page_info *table; + struct hvm_iommu *hd = domain_hvm_iommu(d); + + table = hd->root_table; + level = hd->paging_mode; + + BUG_ON( table == NULL || level < IOMMU_PAGING_MODE_LEVEL_1 || + level > IOMMU_PAGING_MODE_LEVEL_6 ); + + next_table_mfn = page_to_mfn(table); + + if ( level == IOMMU_PAGING_MODE_LEVEL_1 ) + { + pt_mfn[level] = next_table_mfn; + return 0; + } + + while ( level > IOMMU_PAGING_MODE_LEVEL_1 ) + { + unsigned int next_level = level - 1; + pt_mfn[level] = next_table_mfn; + + next_table_vaddr = map_domain_page(next_table_mfn); + pde = next_table_vaddr + pfn_to_pde_idx(pfn, level); + + /* Here might be a super page frame */ + next_table_mfn = amd_iommu_get_next_table_from_pte((uint32_t*)pde) + >> PAGE_SHIFT; + + /* Split super page frame into smaller pieces.*/ + if ( amd_iommu_is_pte_present((u32*)pde) && + (iommu_next_level((u32*)pde) == 0) && + next_table_mfn != 0 ) { - if ( next_table_maddr == 0 ) + int i; + unsigned long mfn, gfn; + unsigned int page_sz; + + page_sz = 1 << (PTE_PER_TABLE_SHIFT * (next_level - 1)); + gfn = pfn & ~((1 << (PTE_PER_TABLE_SHIFT * next_level)) - 1); + mfn = next_table_mfn; + + /* allocate lower level page table */ + table = alloc_amd_iommu_pgtable(); + if ( table == NULL ) + { + AMD_IOMMU_DEBUG("Cannot allocate I/O page table\n"); + unmap_domain_page(next_table_vaddr); + return 1; + } + + next_table_mfn = page_to_mfn(table); + set_iommu_pde_present((u32*)pde, next_table_mfn, next_level, + !!IOMMUF_writable, !!IOMMUF_readable); + + for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ ) + { + set_iommu_pte_present(next_table_mfn, gfn, mfn, next_level, + !!IOMMUF_writable, !!IOMMUF_readable); + mfn += page_sz; + gfn += page_sz; + } + + amd_iommu_flush_all_pages(d); + } + + /* Install lower level page table for non-present entries */ + else if ( !amd_iommu_is_pte_present((u32*)pde) ) + { + if ( next_table_mfn == 0 ) { table = alloc_amd_iommu_pgtable(); if ( table == NULL ) { - printk("AMD-Vi: Cannot allocate I/O page table\n"); - return 0; + AMD_IOMMU_DEBUG("Cannot allocate I/O page table\n"); + unmap_domain_page(next_table_vaddr); + return 1; } - next_table_maddr = page_to_maddr(table); - amd_iommu_set_page_directory_entry( - (u32 *)pde, next_table_maddr, level - 1); + next_table_mfn = page_to_mfn(table); + set_iommu_pde_present((u32*)pde, next_table_mfn, next_level, + !!IOMMUF_writable, !!IOMMUF_readable); } else /* should never reach here */ - return 0; + { + unmap_domain_page(next_table_vaddr); + return 1; + } } - unmap_domain_page(table_vaddr); - table = maddr_to_page(next_table_maddr); + unmap_domain_page(next_table_vaddr); level--; } - return next_table_maddr; + /* mfn of level 1 page table */ + pt_mfn[level] = next_table_mfn; + return 0; } static int update_paging_mode(struct domain *d, unsigned long gfn) @@ -500,7 +675,7 @@ struct page_info *new_root = NULL; struct page_info *old_root = NULL; void *new_root_vaddr; - u64 old_root_maddr; + unsigned long old_root_mfn; struct hvm_iommu *hd = domain_hvm_iommu(d); level = hd->paging_mode; @@ -522,12 +697,13 @@ } new_root_vaddr = __map_domain_page(new_root); - old_root_maddr = page_to_maddr(old_root); - amd_iommu_set_page_directory_entry((u32 *)new_root_vaddr, - old_root_maddr, level); + old_root_mfn = page_to_mfn(old_root); + set_iommu_pde_present(new_root_vaddr, old_root_mfn, level, + !!IOMMUF_writable, !!IOMMUF_readable); level++; old_root = new_root; offset >>= PTE_PER_TABLE_SHIFT; + unmap_domain_page(new_root_vaddr); } if ( new_root != NULL ) @@ -575,15 +751,18 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn, unsigned int flags) { - u64 iommu_l2e; - int need_flush = 0; + bool_t need_flush = 0; struct hvm_iommu *hd = domain_hvm_iommu(d); + unsigned long pt_mfn[7]; + unsigned int merge_level; BUG_ON( !hd->root_table ); if ( iommu_hap_pt_share && is_hvm_domain(d) ) return 0; + memset(pt_mfn, 0, sizeof(pt_mfn)); + spin_lock(&hd->mapping_lock); /* Since HVM domain is initialized with 2 level IO page table, @@ -592,14 +771,14 @@ { if ( update_paging_mode(d, gfn) ) { + spin_unlock(&hd->mapping_lock); AMD_IOMMU_DEBUG("Update page mode failed gfn = %lx\n", gfn); domain_crash(d); return -EFAULT; } } - iommu_l2e = iommu_l2e_from_pfn(hd->root_table, hd->paging_mode, gfn); - if ( iommu_l2e == 0 ) + if ( iommu_pde_from_gfn(d, gfn, pt_mfn) || (pt_mfn[1] == 0) ) { spin_unlock(&hd->mapping_lock); AMD_IOMMU_DEBUG("Invalid IO pagetable entry gfn = %lx\n", gfn); @@ -607,19 +786,48 @@ return -EFAULT; } - need_flush = set_iommu_l1e_present(iommu_l2e, gfn, (u64)mfn << PAGE_SHIFT, + /* Install 4k mapping first */ + need_flush = set_iommu_pte_present(pt_mfn[1], gfn, mfn, + IOMMU_PAGING_MODE_LEVEL_1, !!(flags & IOMMUF_writable), !!(flags & IOMMUF_readable)); - if ( need_flush ) - amd_iommu_flush_pages(d, gfn, 0); + /* Do not increase pde count if io mapping has not been changed */ + if ( !need_flush ) + goto out; + + amd_iommu_flush_pages(d, gfn, 0); + + for ( merge_level = IOMMU_PAGING_MODE_LEVEL_2; + merge_level <= hd->paging_mode; merge_level++ ) + { + if ( pt_mfn[merge_level] == 0 ) + break; + if ( !iommu_update_pde_count(d, pt_mfn[merge_level], + gfn, mfn, merge_level) ) + break; + /* Deallocate lower level page table */ + free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1])); + + if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, + flags, merge_level) ) + { + spin_unlock(&hd->mapping_lock); + AMD_IOMMU_DEBUG("Merge iommu page failed at level %d, " + "gfn = %lx mfn = %lx\n", merge_level, gfn, mfn); + domain_crash(d); + return -EFAULT; + } + } + +out: spin_unlock(&hd->mapping_lock); return 0; } int amd_iommu_unmap_page(struct domain *d, unsigned long gfn) { - u64 iommu_l2e; + unsigned long pt_mfn[7]; struct hvm_iommu *hd = domain_hvm_iommu(d); BUG_ON( !hd->root_table ); @@ -627,6 +835,8 @@ if ( iommu_hap_pt_share && is_hvm_domain(d) ) return 0; + memset(pt_mfn, 0, sizeof(pt_mfn)); + spin_lock(&hd->mapping_lock); /* Since HVM domain is initialized with 2 level IO page table, @@ -635,15 +845,14 @@ { if ( update_paging_mode(d, gfn) ) { + spin_unlock(&hd->mapping_lock); AMD_IOMMU_DEBUG("Update page mode failed gfn = %lx\n", gfn); domain_crash(d); return -EFAULT; } } - iommu_l2e = iommu_l2e_from_pfn(hd->root_table, hd->paging_mode, gfn); - - if ( iommu_l2e == 0 ) + if ( iommu_pde_from_gfn(d, gfn, pt_mfn) || (pt_mfn[1] == 0) ) { spin_unlock(&hd->mapping_lock); AMD_IOMMU_DEBUG("Invalid IO pagetable entry gfn = %lx\n", gfn); @@ -652,7 +861,7 @@ } /* mark PTE as 'page not present' */ - clear_iommu_l1e_present(iommu_l2e, gfn); + clear_iommu_pte_present(pt_mfn[1], gfn); spin_unlock(&hd->mapping_lock); amd_iommu_flush_pages(d, gfn, 0); diff -r 8d6edc3d26d2 -r 80e9fcdaef36 xen/drivers/passthrough/amd/pci_amd_iommu.c --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c Sat Aug 13 10:14:58 2011 +0100 +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Aug 16 15:03:11 2011 +0100 @@ -237,7 +237,9 @@ * XXX Should we really map all non-RAM (above 4G)? Minimally * a pfn_valid() check would seem desirable here. */ - amd_iommu_map_page(d, pfn, pfn, IOMMUF_readable|IOMMUF_writable); + if ( mfn_valid(pfn) ) + amd_iommu_map_page(d, pfn, pfn, + IOMMUF_readable|IOMMUF_writable); } } @@ -333,7 +335,8 @@ { void *table_vaddr, *pde; u64 next_table_maddr; - int index; + int index, next_level, present; + u32 *entry; table_vaddr = __map_domain_page(pg); @@ -343,7 +346,18 @@ { pde = table_vaddr + (index * IOMMU_PAGE_TABLE_ENTRY_SIZE); next_table_maddr = amd_iommu_get_next_table_from_pte(pde); - if ( next_table_maddr != 0 ) + entry = (u32*)pde; + + next_level = get_field_from_reg_u32(entry[0], + IOMMU_PDE_NEXT_LEVEL_MASK, + IOMMU_PDE_NEXT_LEVEL_SHIFT); + + present = get_field_from_reg_u32(entry[0], + IOMMU_PDE_PRESENT_MASK, + IOMMU_PDE_PRESENT_SHIFT); + + if ( (next_table_maddr != 0) && (next_level != 0) + && present ) { deallocate_next_page_table( maddr_to_page(next_table_maddr), level - 1); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 17 08:22:30 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 17 Aug 2011 08:22:30 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qthwr-0002pN-RW; Wed, 17 Aug 2011 08:22:29 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1QthwZ-0002hc-8g for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 08:22:11 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QthwY-0004Tn-Hc for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 16:22:10 +0100 Message-Id: Date: Wed, 17 Aug 2011 16:22:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86-64/mmcfg: relax base address restriction X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313503503 -3600 # Node ID f1e66f813b9b92b109fbfded01082f819360f0bf # Parent 09595fdf36381a9587841fe7dfe1cc82564f0f02 x86-64/mmcfg: relax base address restriction Following what Linux did quite a while ago, don't generally disallow MMCFG base addresses to live above the 4Gb boundary: New systems are assumed to be fine, and SGI ones are, too. Signed-off-by: Jan Beulich --- diff -r 09595fdf3638 -r f1e66f813b9b xen/arch/x86/dmi_scan.c --- a/xen/arch/x86/dmi_scan.c Tue Aug 16 15:04:19 2011 +0100 +++ b/xen/arch/x86/dmi_scan.c Tue Aug 16 15:05:03 2011 +0100 @@ -520,6 +520,76 @@ return count; } +/** + * dmi_get_date - parse a DMI date + * @field: data index (see enum dmi_field) + * @yearp: optional out parameter for the year + * @monthp: optional out parameter for the month + * @dayp: optional out parameter for the day + * + * The date field is assumed to be in the form resembling + * [mm[/dd]]/yy[yy] and the result is stored in the out + * parameters any or all of which can be omitted. + * + * If the field doesn't exist, all out parameters are set to zero + * and false is returned. Otherwise, true is returned with any + * invalid part of date set to zero. + * + * On return, year, month and day are guaranteed to be in the + * range of [0,9999], [0,12] and [0,31] respectively. + */ +bool_t __init dmi_get_date(int field, int *yearp, int *monthp, int *dayp) +{ + int year = 0, month = 0, day = 0; + bool_t exists; + const char *s, *e, *y; + + s = field < DMI_STRING_MAX ? dmi_ident[field] : NULL; + exists = !!s; + if (!exists) + goto out; + + /* + * Determine year first. We assume the date string resembles + * mm/dd/yy[yy] but the original code extracted only the year + * from the end. Keep the behavior in the spirit of no + * surprises. + */ + y = strrchr(s, '/'); + if (!y) + goto out; + + y++; + year = simple_strtoul(y, &e, 10); + if (y != e && year < 100) { /* 2-digit year */ + year += 1900; + if (year < 1996) /* no dates < spec 1.0 */ + year += 100; + } + if (year > 9999) /* year should fit in %04d */ + year = 0; + + /* parse the mm and dd */ + month = simple_strtoul(s, &e, 10); + if (s == e || *e != '/' || !month || month > 12) { + month = 0; + goto out; + } + + s = e + 1; + day = simple_strtoul(s, &e, 10); + if (s == y || s == e || *e != '/' || day > 31) + day = 0; +out: + if (yearp) + *yearp = year; + if (monthp) + *monthp = month; + if (dayp) + *dayp = day; + return exists; +} + void __init dmi_end_boot(void) { unsigned int i; diff -r 09595fdf3638 -r f1e66f813b9b xen/arch/x86/x86_64/acpi_mmcfg.c --- a/xen/arch/x86/x86_64/acpi_mmcfg.c Tue Aug 16 15:04:19 2011 +0100 +++ b/xen/arch/x86/x86_64/acpi_mmcfg.c Tue Aug 16 15:05:03 2011 +0100 @@ -48,6 +48,30 @@ struct acpi_mcfg_allocation *pci_mmcfg_config; int pci_mmcfg_config_num; +static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg, + struct acpi_mcfg_allocation *cfg) +{ + int year; + + if (cfg->address < 0xFFFFFFFF) + return 0; + + if (!strcmp(mcfg->header.oem_id, "SGI") || + !strcmp(mcfg->header.oem_id, "SGI2")) + return 0; + + if (mcfg->header.revision >= 1 && + dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && + year >= 2010) + return 0; + + printk(KERN_ERR "MCFG region for %04x:%02x-%02x at %#"PRIx64 + " (above 4GB) ignored\n", + cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number, + cfg->address); + return -EINVAL; +} + int __init acpi_parse_mcfg(struct acpi_table_header *header) { struct acpi_table_mcfg *mcfg; @@ -82,9 +106,7 @@ pci_mmcfg_config_num * sizeof(*pci_mmcfg_config)); for (i = 0; i < pci_mmcfg_config_num; ++i) { - if (pci_mmcfg_config[i].address > 0xFFFFFFFF) { - printk(KERN_ERR PREFIX - "MMCONFIG not in low 4GB of memory\n"); + if (acpi_mcfg_check_entry(mcfg, &pci_mmcfg_config[i])) { xfree(pci_mmcfg_config); pci_mmcfg_config_num = 0; return -ENODEV; diff -r 09595fdf3638 -r f1e66f813b9b xen/include/xen/dmi.h --- a/xen/include/xen/dmi.h Tue Aug 16 15:04:19 2011 +0100 +++ b/xen/include/xen/dmi.h Tue Aug 16 15:05:03 2011 +0100 @@ -36,6 +36,7 @@ extern void dmi_scan_machine(void); extern int dmi_get_table(u32 *base, u32 *len); extern void dmi_efi_get_table(void *); +bool_t dmi_get_date(int field, int *yearp, int *monthp, int *dayp); extern void dmi_end_boot(void); #endif /* __DMI_H__ */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 17 08:22:37 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 17 Aug 2011 08:22:37 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qthwz-0002sc-9z; Wed, 17 Aug 2011 08:22:37 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qthwa-0002ho-3u for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 08:22:12 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QthwZ-0004Ug-2P for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 16:22:11 +0100 Message-Id: Date: Wed, 17 Aug 2011 16:22:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] passthrough: don't use open coded IO-APIC accesses X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313503530 -3600 # Node ID 5c1ebc117f9901bc155d2b92ae902a4144767dfb # Parent f1e66f813b9b92b109fbfded01082f819360f0bf passthrough: don't use open coded IO-APIC accesses This makes the respective functions quite a bit more legible. Since this requires fiddling with __ioapic_{read,write}_entry() anyway, make them and their wrappers have their argument types match those of __io_apic_{read,write}() (int -> unsigned int). No functional change intended. Signed-off-by: Jan Beulich --- diff -r f1e66f813b9b -r 5c1ebc117f99 xen/arch/x86/io_apic.c --- a/xen/arch/x86/io_apic.c Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/arch/x86/io_apic.c Tue Aug 16 15:05:30 2011 +0100 @@ -162,7 +162,8 @@ struct IO_APIC_route_entry entry; }; -static struct IO_APIC_route_entry __ioapic_read_entry(int apic, int pin, int raw) +struct IO_APIC_route_entry __ioapic_read_entry( + unsigned int apic, unsigned int pin, bool_t raw) { unsigned int (*read)(unsigned int, unsigned int) = raw ? __io_apic_read : io_apic_read; @@ -172,7 +173,8 @@ return eu.entry; } -static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin, int raw) +static struct IO_APIC_route_entry ioapic_read_entry( + unsigned int apic, unsigned int pin, bool_t raw) { struct IO_APIC_route_entry entry; unsigned long flags; @@ -183,8 +185,9 @@ return entry; } -static void -__ioapic_write_entry(int apic, int pin, int raw, struct IO_APIC_route_entry e) +void __ioapic_write_entry( + unsigned int apic, unsigned int pin, bool_t raw, + struct IO_APIC_route_entry e) { void (*write)(unsigned int, unsigned int, unsigned int) = raw ? __io_apic_write : io_apic_write; @@ -195,7 +198,9 @@ (*write)(apic, 0x10 + 2*pin, eu.w1); } -static void ioapic_write_entry(int apic, int pin, int raw, struct IO_APIC_route_entry e) +static void ioapic_write_entry( + unsigned int apic, unsigned int pin, bool_t raw, + struct IO_APIC_route_entry e) { unsigned long flags; spin_lock_irqsave(&ioapic_lock, flags); diff -r f1e66f813b9b -r 5c1ebc117f99 xen/drivers/passthrough/amd/iommu_intr.c --- a/xen/drivers/passthrough/amd/iommu_intr.c Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_intr.c Tue Aug 16 15:05:30 2011 +0100 @@ -374,13 +374,6 @@ update_intremap_entry_from_msi_msg(iommu, pdev, msi_desc, msg); } -unsigned int amd_iommu_read_ioapic_from_ire( - unsigned int apic, unsigned int reg) -{ - *IO_APIC_BASE(apic) = reg; - return *(IO_APIC_BASE(apic)+4); -} - void amd_iommu_read_msi_from_ire( struct msi_desc *msi_desc, struct msi_msg *msg) { diff -r f1e66f813b9b -r 5c1ebc117f99 xen/drivers/passthrough/amd/pci_amd_iommu.c --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Aug 16 15:05:30 2011 +0100 @@ -467,6 +467,8 @@ return rt; } +#include + const struct iommu_ops amd_iommu_ops = { .init = amd_iommu_domain_init, .dom0_init = amd_iommu_dom0_init, @@ -480,7 +482,7 @@ .get_device_group_id = amd_iommu_group_id, .update_ire_from_apic = amd_iommu_ioapic_update_ire, .update_ire_from_msi = amd_iommu_msi_msg_update_ire, - .read_apic_from_ire = amd_iommu_read_ioapic_from_ire, + .read_apic_from_ire = __io_apic_read, .read_msi_from_ire = amd_iommu_read_msi_from_ire, .suspend = amd_iommu_suspend, .resume = amd_iommu_resume, diff -r f1e66f813b9b -r 5c1ebc117f99 xen/drivers/passthrough/vtd/intremap.c --- a/xen/drivers/passthrough/vtd/intremap.c Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/drivers/passthrough/vtd/intremap.c Tue Aug 16 15:05:30 2011 +0100 @@ -34,6 +34,22 @@ #ifdef __ia64__ #define nr_ioapics iosapic_get_nr_iosapics() #define nr_ioapic_registers(i) iosapic_get_nr_pins(i) +#define __io_apic_read(apic, reg) \ + (*IO_APIC_BASE(apic) = reg, *(IO_APIC_BASE(apic)+4)) +#define __io_apic_write(apic, reg, val) \ + (*IO_APIC_BASE(apic) = reg, *(IO_APIC_BASE(apic)+4) = (val)) +#define __ioapic_read_entry(apic, pin, raw) ({ \ + struct IO_xAPIC_route_entry _e_; \ + ASSERT(raw); \ + ((u32 *)&_e_)[0] = __io_apic_read(apic, 0x10 + 2 * (pin)); \ + ((u32 *)&_e_)[1] = __io_apic_read(apic, 0x11 + 2 * (pin)); \ + _e_; \ +}) +#define __ioapic_write_entry(apic, pin, raw, ent) ({ \ + ASSERT(raw); \ + __io_apic_write(apic, 0x10 + 2 * (pin), ((u32 *)&_e_)[0]); \ + __io_apic_write(apic, 0x11 + 2 * (pin), ((u32 *)&_e_)[1]); \ +}) #else #include #include @@ -374,25 +390,12 @@ if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 || (ir_ctrl->iremap_num == 0) || ( (index = apic_pin_2_ir_idx[apic][ioapic_pin]) < 0 ) ) - { - *IO_APIC_BASE(apic) = reg; - return *(IO_APIC_BASE(apic)+4); - } + return __io_apic_read(apic, reg); - if ( rte_upper ) - reg--; - - /* read lower and upper 32-bits of rte entry */ - *IO_APIC_BASE(apic) = reg; - *(((u32 *)&old_rte) + 0) = *(IO_APIC_BASE(apic)+4); - *IO_APIC_BASE(apic) = reg + 1; - *(((u32 *)&old_rte) + 1) = *(IO_APIC_BASE(apic)+4); + old_rte = __ioapic_read_entry(apic, ioapic_pin, TRUE); if ( remap_entry_to_ioapic_rte(iommu, index, &old_rte) ) - { - *IO_APIC_BASE(apic) = rte_upper ? (reg + 1) : reg; - return *(IO_APIC_BASE(apic)+4); - } + return __io_apic_read(apic, reg); if ( rte_upper ) return (*(((u32 *)&old_rte) + 1)); @@ -413,49 +416,31 @@ if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 ) { - *IO_APIC_BASE(apic) = reg; - *(IO_APIC_BASE(apic)+4) = value; + __io_apic_write(apic, reg, value); return; } - if ( rte_upper ) - reg--; - - /* read both lower and upper 32-bits of rte entry */ - *IO_APIC_BASE(apic) = reg; - *(((u32 *)&old_rte) + 0) = *(IO_APIC_BASE(apic)+4); - *IO_APIC_BASE(apic) = reg + 1; - *(((u32 *)&old_rte) + 1) = *(IO_APIC_BASE(apic)+4); + old_rte = __ioapic_read_entry(apic, ioapic_pin, TRUE); remap_rte = (struct IO_APIC_route_remap_entry *) &old_rte; /* mask the interrupt while we change the intremap table */ saved_mask = remap_rte->mask; remap_rte->mask = 1; - *IO_APIC_BASE(apic) = reg; - *(IO_APIC_BASE(apic)+4) = *(((int *)&old_rte)+0); + __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte); remap_rte->mask = saved_mask; if ( ioapic_rte_to_remap_entry(iommu, apic, ioapic_pin, &old_rte, rte_upper, value) ) { - *IO_APIC_BASE(apic) = rte_upper ? (reg + 1) : reg; - *(IO_APIC_BASE(apic)+4) = value; + __io_apic_write(apic, reg, value); /* Recover the original value of 'mask' bit */ if ( rte_upper ) - { - *IO_APIC_BASE(apic) = reg; - *(IO_APIC_BASE(apic)+4) = *(((u32 *)&old_rte)+0); - } - return; + __io_apic_write(apic, reg & ~1, *(u32 *)&old_rte); } - - /* write new entry to ioapic */ - *IO_APIC_BASE(apic) = reg + 1; - *(IO_APIC_BASE(apic)+4) = *(((u32 *)&old_rte)+1); - *IO_APIC_BASE(apic) = reg; - *(IO_APIC_BASE(apic)+4) = *(((u32 *)&old_rte)+0); + else + __ioapic_write_entry(apic, ioapic_pin, TRUE, old_rte); } #if defined(__i386__) || defined(__x86_64__) diff -r f1e66f813b9b -r 5c1ebc117f99 xen/drivers/passthrough/vtd/utils.c --- a/xen/drivers/passthrough/vtd/utils.c Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/drivers/passthrough/vtd/utils.c Tue Aug 16 15:05:30 2011 +0100 @@ -261,9 +261,8 @@ /* Dump the I/O xAPIC redirection table(s). */ if ( iommu_enabled ) { - int apic, reg; + int apic; union IO_APIC_reg_01 reg_01; - struct IO_APIC_route_entry rte = { 0 }; struct IO_APIC_route_remap_entry *remap; struct ir_ctrl *ir_ctrl; @@ -277,19 +276,14 @@ printk( "\nRedirection table of IOAPIC %x:\n", apic); - reg = 1; /* IO xAPIC Version Register. */ - *IO_APIC_BASE(apic) = reg; - reg_01.raw = *(IO_APIC_BASE(apic)+4); + /* IO xAPIC Version Register. */ + reg_01.raw = __io_apic_read(apic, 1); printk(" #entry IDX FMT MASK TRIG IRR POL STAT DELI VECTOR\n"); for ( i = 0; i <= reg_01.bits.entries; i++ ) { - reg = 0x10 + i*2; - *IO_APIC_BASE(apic) = reg; - *(((u32 *)&rte) + 0) = *(IO_APIC_BASE(apic)+4); - - *IO_APIC_BASE(apic) = reg + 1; - *(((u32 *)&rte) + 1) = *(IO_APIC_BASE(apic)+4); + struct IO_APIC_route_entry rte = + __ioapic_read_entry(apic, i, TRUE); remap = (struct IO_APIC_route_remap_entry *) &rte; if ( !remap->format ) diff -r f1e66f813b9b -r 5c1ebc117f99 xen/drivers/passthrough/vtd/vtd.h --- a/xen/drivers/passthrough/vtd/vtd.h Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/drivers/passthrough/vtd/vtd.h Tue Aug 16 15:05:30 2011 +0100 @@ -27,6 +27,9 @@ #define UNMAP_ME_PHANTOM_FUNC 0 /* Accomodate both IOAPIC and IOSAPIC. */ +#ifndef __ia64__ +#define IO_xAPIC_route_entry IO_APIC_route_entry +#else struct IO_xAPIC_route_entry { __u32 vector : 8, delivery_mode : 3, /* 000: FIXED @@ -53,15 +56,14 @@ logical_dest : 8; } logical; -#ifdef __ia64__ struct { __u32 __reserved_1 : 16, dest_id : 16; }; -#endif } dest; } __attribute__ ((packed)); +#endif struct IO_APIC_route_remap_entry { union { diff -r f1e66f813b9b -r 5c1ebc117f99 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h --- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h Tue Aug 16 15:05:30 2011 +0100 @@ -93,8 +93,6 @@ struct msi_desc *msi_desc, struct msi_msg *msg); void amd_iommu_read_msi_from_ire( struct msi_desc *msi_desc, struct msi_msg *msg); -unsigned int amd_iommu_read_ioapic_from_ire( - unsigned int apic, unsigned int reg); extern int ioapic_bdf[MAX_IO_APICS]; extern void *shared_intremap_table; diff -r f1e66f813b9b -r 5c1ebc117f99 xen/include/asm-x86/io_apic.h --- a/xen/include/asm-x86/io_apic.h Tue Aug 16 15:05:03 2011 +0100 +++ b/xen/include/asm-x86/io_apic.h Tue Aug 16 15:05:30 2011 +0100 @@ -200,6 +200,12 @@ extern void dump_ioapic_irq_info(void); +extern struct IO_APIC_route_entry __ioapic_read_entry( + unsigned int apic, unsigned int pin, bool_t raw); +void __ioapic_write_entry( + unsigned int apic, unsigned int pin, bool_t raw, + struct IO_APIC_route_entry); + extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); extern int save_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 17 08:22:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 17 Aug 2011 08:22:50 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QthxC-0002vx-8R; Wed, 17 Aug 2011 08:22:50 -0700 Received: from xenbits.xen.org ([93.93.131.152]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qthwa-0002hp-9l for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 08:22:12 -0700 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QthwZ-0004VZ-Iz for xen-changelog@lists.xensource.com; Wed, 17 Aug 2011 16:22:11 +0100 Message-Id: Date: Wed, 17 Aug 2011 16:22:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: simplify (and fix) clear_IO_APIC{, _pin}() X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313503555 -3600 # Node ID fc2be6cb89ad49efd90fe1b650f7efaab72f61b2 # Parent 5c1ebc117f9901bc155d2b92ae902a4144767dfb x86: simplify (and fix) clear_IO_APIC{,_pin}() These are used during bootup and (emergency) shutdown only, and their only purpose is to get the actual IO-APIC's RTE(s) cleared. Consequently, only the "raw" accessors should be used (and the ones going through interrupt remapping code can be skipped), with the exception of determining the delivery mode: This one must always go through the interrupt remapping path, as in the VT-d case the actual IO-APIC's RTE will have the delivery mode always set to zero (which before possibly could have resulted in such an entry getting cleared in the "raw" pass, though I haven't observed this case in practice). Signed-off-by: Jan Beulich --- diff -r 5c1ebc117f99 -r fc2be6cb89ad xen/arch/x86/io_apic.c --- a/xen/arch/x86/io_apic.c Tue Aug 16 15:05:30 2011 +0100 +++ b/xen/arch/x86/io_apic.c Tue Aug 16 15:05:55 2011 +0100 @@ -372,14 +372,12 @@ spin_unlock_irqrestore(&ioapic_lock, flags); } -#define clear_IO_APIC_pin(a,p) __clear_IO_APIC_pin(a,p,0) -#define clear_IO_APIC_pin_raw(a,p) __clear_IO_APIC_pin(a,p,1) -static void __clear_IO_APIC_pin(unsigned int apic, unsigned int pin, int raw) +static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin) { struct IO_APIC_route_entry entry; /* Check delivery_mode to be sure we're not clearing an SMI pin */ - entry = ioapic_read_entry(apic, pin, raw); + entry = __ioapic_read_entry(apic, pin, FALSE); if (entry.delivery_mode == dest_SMI) return; @@ -388,7 +386,7 @@ */ memset(&entry, 0, sizeof(entry)); entry.mask = 1; - ioapic_write_entry(apic, pin, raw, entry); + __ioapic_write_entry(apic, pin, TRUE, entry); } static void clear_IO_APIC (void) @@ -396,10 +394,8 @@ int apic, pin; for (apic = 0; apic < nr_ioapics; apic++) { - for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { + for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) clear_IO_APIC_pin(apic, pin); - clear_IO_APIC_pin_raw(apic, pin); - } } } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 18 04:00:57 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 18 Aug 2011 04:00:57 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qu0LI-0000Fr-52; Thu, 18 Aug 2011 04:00:56 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qu0Kg-0000Ek-2v for xen-changelog@lists.xensource.com; Thu, 18 Aug 2011 04:00:26 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-15.tower-21.messagelabs.com!1313665214!47397392!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13539 invoked from network); 18 Aug 2011 11:00:15 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 18 Aug 2011 11:00:15 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qu0Ka-0003Dq-Jx for xen-changelog@lists.xensource.com; Thu, 18 Aug 2011 12:00:12 +0100 Message-Id: Date: Thu, 18 Aug 2011 12:00:11 +0100 From: Xen patchbot-4.0-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.0-testing] VT-d: always clean up dpci timers. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1313504826 -3600 # Node ID cb453558fd2bfd52b715e9ae650cc9e2a8145d17 # Parent f09ab04f614e108770a3c44084195d7522fb6997 VT-d: always clean up dpci timers. If a VM has all its PCI devices deassigned, need_iommu(d) becomes false but it might still have DPCI EOI timers that were init_timer()d but not yet kill_timer()d. That causes xen to crash later because the linked list of inactive timers gets corrupted, e.g.: (XEN) Xen call trace: (XEN) [] set_timer+0x1c2/0x24f (XEN) [] schedule+0x129/0x5dd (XEN) [] __do_softirq+0x7e/0x89 (XEN) [] do_softirq+0x26/0x28 (XEN) [] idle_loop+0x5a/0x5c (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Assertion 'entry->next->prev == entry' failed at /local/scratch/tdeegan/xen-unstable.hg/xen/include:172 (XEN) **************************************** The following patch makes sure that the domain destruction path always clears up the DPCI state even if !needs_iommu(d). Signed-off-by: Tim Deegan xen-unstable changeset: 23746:aa54b8175954 xen-unstable date: Mon Jul 25 16:41:33 2011 +0100 --- diff -r f09ab04f614e -r cb453558fd2b xen/drivers/passthrough/pci.c --- a/xen/drivers/passthrough/pci.c Wed Jul 27 23:12:31 2011 +0100 +++ b/xen/drivers/passthrough/pci.c Tue Aug 16 15:27:06 2011 +0100 @@ -249,9 +249,6 @@ if ( !iommu_enabled ) return; - if ( !need_iommu(d) ) - return; - spin_lock(&d->event_lock); hvm_irq_dpci = domain_get_irq_dpci(d); if ( hvm_irq_dpci != NULL ) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 02:11:20 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 02:11:20 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QuL6m-0005ST-R1; Fri, 19 Aug 2011 02:11:20 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QuL6h-0005Rn-UG for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 02:11:16 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-15.tower-216.messagelabs.com!1313745064!14951948!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 20814 invoked from network); 19 Aug 2011 09:11:05 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 19 Aug 2011 09:11:05 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QuL6W-000756-Lf for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 10:11:04 +0100 Message-Id: Date: Fri, 19 Aug 2011 10:11:04 +0100 From: Xen patchbot-linux-2.6.18-xen To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [linux-2.6.18-xen] xen/i386: follow-up to c/s 1101 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313744027 -3600 # Node ID 0b8a9b22b70a2a69f829182368ec4590d5e93792 # Parent 82782f1361a9949554141eb2edeac18b92b27260 xen/i386: follow-up to c/s 1101 The numbers obtained from the hypervisor really can't ever lead to an overflow here, only the original calculation going through the order of the range could have. This avoids the (as Jeremy points outs) somewhat ugly NULL-based calculation here. Signed-off-by: Jan Beulich --- diff -r 82782f1361a9 -r 0b8a9b22b70a arch/i386/mach-xen/setup.c --- a/arch/i386/mach-xen/setup.c Mon Jul 25 13:49:25 2011 +0100 +++ b/arch/i386/mach-xen/setup.c Fri Aug 19 09:53:47 2011 +0100 @@ -110,10 +110,8 @@ machine_to_phys_nr = mapping.max_mfn + 1; } else machine_to_phys_nr = MACH2PHYS_NR_ENTRIES; - if (machine_to_phys_mapping + machine_to_phys_nr - < machine_to_phys_mapping) - machine_to_phys_nr = (unsigned long *)NULL - - machine_to_phys_mapping; + WARN_ON(machine_to_phys_mapping + (machine_to_phys_nr - 1) + < machine_to_phys_mapping); if (!xen_feature(XENFEAT_auto_translated_physmap)) phys_to_machine_mapping = _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 07:57:28 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 07:57:28 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QuQVj-0001s5-6r; Fri, 19 Aug 2011 07:57:27 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QuQTb-00017r-Ev for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 07:55:16 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-2.tower-216.messagelabs.com!1313765709!15328799!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 15126 invoked from network); 19 Aug 2011 14:55:09 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 19 Aug 2011 14:55:09 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QuQTU-0007cQ-Qi for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 15:55:08 +0100 Message-Id: Date: Fri, 19 Aug 2011 15:55:08 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] x86/KEXEC: disable hpet legacy broadcasts earlier X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Andrew Cooper # Date 1313744425 -3600 # Node ID a79c1d5b946edce0f9f5b4bda061e2ad98adc4da # Parent 98c98daab56afa001e966c803f242439645a23d0 x86/KEXEC: disable hpet legacy broadcasts earlier On x2apic machines which booted in xapic mode, hpet_disable_legacy_broadcast() sends an event check IPI to all online processors. This leads to a protection fault as the genapic blindly pokes x2apic MSRs while the local apic is in xapic mode. One option is to change genapic when we shut down the local apic, but there are still problems with trying to IPI processors in the online processor map which are actually sitting in NMI loops Another option is to have each CPU take itself out of the online CPU map during the NMI shootdown. Realistically however, disabling hpet legacy broadcasts earlier in the kexec path is the easiest fix to the problem. Signed-off-by: Andrew Cooper xen-unstable changeset: 23776:0ddb4481f883 xen-unstable date: Fri Aug 19 09:58:22 2011 +0100 --- diff -r 98c98daab56a -r a79c1d5b946e xen/arch/x86/crash.c --- a/xen/arch/x86/crash.c Tue Aug 16 15:21:46 2011 +0100 +++ b/xen/arch/x86/crash.c Fri Aug 19 10:00:25 2011 +0100 @@ -29,6 +29,7 @@ #include #include #include +#include static atomic_t waiting_for_crash_ipi; static unsigned int crashing_cpu; @@ -61,6 +62,9 @@ local_irq_disable(); + if ( hpet_broadcast_is_available() ) + hpet_disable_legacy_broadcast(); + crashing_cpu = smp_processor_id(); local_irq_count(crashing_cpu) = 0; diff -r 98c98daab56a -r a79c1d5b946e xen/arch/x86/machine_kexec.c --- a/xen/arch/x86/machine_kexec.c Tue Aug 16 15:21:46 2011 +0100 +++ b/xen/arch/x86/machine_kexec.c Fri Aug 19 10:00:25 2011 +0100 @@ -96,9 +96,6 @@ .limit = LAST_RESERVED_GDT_BYTE }; - if ( hpet_broadcast_is_available() ) - hpet_disable_legacy_broadcast(); - /* We are about to permenantly jump out of the Xen context into the kexec * purgatory code. We really dont want to be still servicing interupts. */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 23:11:25 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 23:11:25 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QuemC-0004b3-Rx; Fri, 19 Aug 2011 23:11:24 -0700 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xensource.com with esmtp (Exim 4.43) id 1Quely-0004Wq-Nc for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 23:11:13 -0700 Received: from [85.158.139.83:28628] by server-2.bemta-5.messagelabs.com id 24/2A-08695-DFF4F4E4; Sat, 20 Aug 2011 06:11:09 +0000 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-12.tower-182.messagelabs.com!1313820669!15109977!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 15940 invoked from network); 20 Aug 2011 06:11:09 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 20 Aug 2011 06:11:09 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Quelx-00060C-8L for xen-changelog@lists.xensource.com; Sat, 20 Aug 2011 07:11:09 +0100 Message-Id: Date: Sat, 20 Aug 2011 07:11:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86-64/EFI: construct EDD data from device path protocol information X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313744120 -3600 # Node ID e35c5202625ef5534561f84352833ad9467d986c # Parent dd90b59cb11c60c48e174c899190e2967341fe32 x86-64/EFI: construct EDD data from device path protocol information In the absence of a BIOS to handle INT13 requests, this information must be constructed artificially instead when booted from EFI. Signed-off-by: Jan Beulich --- diff -r dd90b59cb11c -r e35c5202625e xen/arch/x86/boot/edd.S --- a/xen/arch/x86/boot/edd.S Fri Aug 19 09:54:53 2011 +0100 +++ b/xen/arch/x86/boot/edd.S Fri Aug 19 09:55:20 2011 +0100 @@ -16,21 +16,13 @@ * Updated and ported for Xen by Keir Fraser June 2007 */ +#include + .code16 /* Offset of disc signature in the MBR. */ #define EDD_MBR_SIG_OFFSET 0x1B8 -/* Maximum number of EDD information structures at boot_edd_info. */ -#define EDD_INFO_MAX 6 - -/* Maximum number of MBR signatures at boot_mbr_signature. */ -#define EDD_MBR_SIG_MAX 16 - -/* Size of components of EDD information structure. */ -#define EDDEXTSIZE 8 -#define EDDPARMSIZE 74 - get_edd: cmpb $2, bootsym(opt_edd) # edd=off ? je edd_done diff -r dd90b59cb11c -r e35c5202625e xen/arch/x86/efi/boot.c --- a/xen/arch/x86/efi/boot.c Fri Aug 19 09:54:53 2011 +0100 +++ b/xen/arch/x86/efi/boot.c Fri Aug 19 09:55:20 2011 +0100 @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -539,6 +540,18 @@ *s = 0; } +static void __init edd_put_string(u8 *dst, size_t n, const char *src) +{ + while ( n-- && *src ) + *dst++ = *src++; + if ( *src ) + PrintErrMesg(L"Internal error populating EDD info", + EFI_BUFFER_TOO_SMALL); + while ( n-- ) + *dst++ = ' '; +} +#define edd_put_string(d, s) edd_put_string(d, ARRAY_SIZE(d), s) + static int __init set_color(u32 mask, int bpp, u8 *pos, u8 *sz) { if ( bpp < 0 ) @@ -607,6 +620,8 @@ { static EFI_GUID __initdata loaded_image_guid = LOADED_IMAGE_PROTOCOL; static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; + static EFI_GUID __initdata bio_guid = BLOCK_IO_PROTOCOL; + static EFI_GUID __initdata devp_guid = DEVICE_PATH_PROTOCOL; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; unsigned int i, argc; @@ -887,7 +902,148 @@ place_string(&mbi.mem_upper, NULL); - /* XXX Collect EDD info. */ + /* Collect EDD info. */ + BUILD_BUG_ON(offsetof(struct edd_info, edd_device_params) != EDDEXTSIZE); + BUILD_BUG_ON(sizeof(struct edd_device_params) != EDDPARMSIZE); + size = 0; + status = efi_bs->LocateHandle(ByProtocol, &bio_guid, NULL, &size, NULL); + if ( status == EFI_BUFFER_TOO_SMALL ) + status = efi_bs->AllocatePool(EfiLoaderData, size, (void **)&handles); + if ( !EFI_ERROR(status) ) + status = efi_bs->LocateHandle(ByProtocol, &bio_guid, NULL, &size, + handles); + if ( EFI_ERROR(status) ) + size = 0; + for ( i = 0; i < size / sizeof(*handles); ++i ) + { + EFI_BLOCK_IO *bio; + EFI_DEV_PATH_PTR devp; + struct edd_info *info = boot_edd_info + boot_edd_info_nr; + struct edd_device_params *params = &info->edd_device_params; + enum { root, acpi, pci, ctrlr } state = root; + + status = efi_bs->HandleProtocol(handles[i], &bio_guid, (void **)&bio); + if ( EFI_ERROR(status) || + bio->Media->RemovableMedia || + bio->Media->LogicalPartition ) + continue; + if ( boot_edd_info_nr < EDD_INFO_MAX ) + { + info->device = 0x80 + boot_edd_info_nr; /* fake */ + info->version = 0x11; + params->length = offsetof(struct edd_device_params, dpte_ptr); + params->number_of_sectors = bio->Media->LastBlock + 1; + params->bytes_per_sector = bio->Media->BlockSize; + params->dpte_ptr = ~0; + } + ++boot_edd_info_nr; + status = efi_bs->HandleProtocol(handles[i], &devp_guid, + (void **)&devp); + if ( EFI_ERROR(status) ) + continue; + for ( ; !IsDevicePathEnd(devp.DevPath); + devp.DevPath = NextDevicePathNode(devp.DevPath) ) + { + switch ( DevicePathType(devp.DevPath) ) + { + const u8 *p; + + case ACPI_DEVICE_PATH: + if ( state != root || boot_edd_info_nr > EDD_INFO_MAX ) + break; + switch ( DevicePathSubType(devp.DevPath) ) + { + case ACPI_DP: + if ( devp.Acpi->HID != EISA_PNP_ID(0xA03) && + devp.Acpi->HID != EISA_PNP_ID(0xA08) ) + break; + params->interface_path.pci.bus = devp.Acpi->UID; + state = acpi; + break; + case EXPANDED_ACPI_DP: + /* XXX */ + break; + } + break; + case HARDWARE_DEVICE_PATH: + if ( state != acpi || + DevicePathSubType(devp.DevPath) != HW_PCI_DP || + boot_edd_info_nr > EDD_INFO_MAX ) + break; + state = pci; + edd_put_string(params->host_bus_type, "PCI"); + params->interface_path.pci.slot = devp.Pci->Device; + params->interface_path.pci.function = devp.Pci->Function; + break; + case MESSAGING_DEVICE_PATH: + if ( state != pci || boot_edd_info_nr > EDD_INFO_MAX ) + break; + state = ctrlr; + switch ( DevicePathSubType(devp.DevPath) ) + { + case MSG_ATAPI_DP: + edd_put_string(params->interface_type, "ATAPI"); + params->interface_path.pci.channel = + devp.Atapi->PrimarySecondary; + params->device_path.atapi.device = devp.Atapi->SlaveMaster; + params->device_path.atapi.lun = devp.Atapi->Lun; + break; + case MSG_SCSI_DP: + edd_put_string(params->interface_type, "SCSI"); + params->device_path.scsi.id = devp.Scsi->Pun; + params->device_path.scsi.lun = devp.Scsi->Lun; + break; + case MSG_FIBRECHANNEL_DP: + edd_put_string(params->interface_type, "FIBRE"); + params->device_path.fibre.wwid = devp.FibreChannel->WWN; + params->device_path.fibre.lun = devp.FibreChannel->Lun; + break; + case MSG_1394_DP: + edd_put_string(params->interface_type, "1394"); + params->device_path.i1394.eui = devp.F1394->Guid; + break; + case MSG_USB_DP: + case MSG_USB_CLASS_DP: + edd_put_string(params->interface_type, "USB"); + break; + case MSG_I2O_DP: + edd_put_string(params->interface_type, "I2O"); + params->device_path.i2o.identity_tag = devp.I2O->Tid; + break; + default: + continue; + } + info->version = 0x30; + params->length = sizeof(struct edd_device_params); + params->key = 0xbedd; + params->device_path_info_length = + sizeof(struct edd_device_params) - + offsetof(struct edd_device_params, key); + for ( p = (const u8 *)¶ms->key; p < ¶ms->checksum; ++p ) + params->checksum -= *p; + break; + case MEDIA_DEVICE_PATH: + if ( DevicePathSubType(devp.DevPath) == MEDIA_HARDDRIVE_DP && + devp.HardDrive->MBRType == MBR_TYPE_PCAT && + boot_mbr_signature_nr < EDD_MBR_SIG_MAX ) + { + struct mbr_signature *sig = boot_mbr_signature + + boot_mbr_signature_nr; + + sig->device = 0x80 + boot_edd_info_nr; /* fake */ + memcpy(&sig->signature, devp.HardDrive->Signature, + sizeof(sig->signature)); + ++boot_mbr_signature_nr; + } + break; + } + } + } + if ( handles ) + efi_bs->FreePool(handles); + if ( boot_edd_info_nr > EDD_INFO_MAX ) + boot_edd_info_nr = EDD_INFO_MAX; + /* XXX Collect EDID info. */ if ( cpuid_eax(0x80000000) > 0x80000000 ) diff -r dd90b59cb11c -r e35c5202625e xen/include/asm-x86/edd.h --- a/xen/include/asm-x86/edd.h Fri Aug 19 09:54:53 2011 +0100 +++ b/xen/include/asm-x86/edd.h Fri Aug 19 09:55:20 2011 +0100 @@ -23,6 +23,8 @@ #ifndef __XEN_EDD_H__ #define __XEN_EDD_H__ +#ifndef __ASSEMBLY__ + struct edd_info { /* Int13, Fn48: Check Extensions Present. */ u8 device; /* %dl: device */ @@ -33,10 +35,106 @@ u8 legacy_max_head; /* %dh: maximum head number */ u8 legacy_sectors_per_track; /* %cl[5:0]: maximum sector number */ /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */ - struct { + struct edd_device_params { u16 length; - u8 data[72]; - } edd_device_params; + u16 info_flags; + u32 num_default_cylinders; + u32 num_default_heads; + u32 sectors_per_track; + u64 number_of_sectors; + u16 bytes_per_sector; + u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */ + u16 key; /* = 0xBEDD */ + u8 device_path_info_length; + u8 reserved2; + u16 reserved3; + u8 host_bus_type[4]; + u8 interface_type[8]; + union { + struct { + u16 base_address; + u16 reserved1; + u32 reserved2; + } __attribute__ ((packed)) isa; + struct { + u8 bus; + u8 slot; + u8 function; + u8 channel; + u32 reserved; + } __attribute__ ((packed)) pci; + /* pcix is same as pci */ + struct { + u64 reserved; + } __attribute__ ((packed)) ibnd; + struct { + u64 reserved; + } __attribute__ ((packed)) xprs; + struct { + u64 reserved; + } __attribute__ ((packed)) htpt; + struct { + u64 reserved; + } __attribute__ ((packed)) unknown; + } interface_path; + union { + struct { + u8 device; + u8 reserved1; + u16 reserved2; + u32 reserved3; + u64 reserved4; + } __attribute__ ((packed)) ata; + struct { + u8 device; + u8 lun; + u8 reserved1; + u8 reserved2; + u32 reserved3; + u64 reserved4; + } __attribute__ ((packed)) atapi; + struct { + u16 id; + u64 lun; + u16 reserved1; + u32 reserved2; + } __attribute__ ((packed)) scsi; + struct { + u64 serial_number; + u64 reserved; + } __attribute__ ((packed)) usb; + struct { + u64 eui; + u64 reserved; + } __attribute__ ((packed)) i1394; + struct { + u64 wwid; + u64 lun; + } __attribute__ ((packed)) fibre; + struct { + u64 identity_tag; + u64 reserved; + } __attribute__ ((packed)) i2o; + struct { + u32 array_number; + u32 reserved1; + u64 reserved2; + } __attribute__ ((packed)) raid; + struct { + u8 device; + u8 reserved1; + u16 reserved2; + u32 reserved3; + u64 reserved4; + } __attribute__ ((packed)) sata; + struct { + u64 reserved1; + u64 reserved2; + } __attribute__ ((packed)) unknown; + } device_path; + u8 reserved4; + u8 checksum; + } __attribute__ ((packed)) edd_device_params; } __attribute__ ((packed)); struct mbr_signature { @@ -51,4 +149,16 @@ extern struct edd_info boot_edd_info[]; extern u8 boot_edd_info_nr; +#endif /* __ASSEMBLY__ */ + +/* Maximum number of EDD information structures at boot_edd_info. */ +#define EDD_INFO_MAX 6 + +/* Maximum number of MBR signatures at boot_mbr_signature. */ +#define EDD_MBR_SIG_MAX 16 + +/* Size of components of EDD information structure. */ +#define EDDEXTSIZE 8 +#define EDDPARMSIZE 74 + #endif /* __XEN_EDD_H__ */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 23:11:34 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 23:11:34 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QuemM-0004eJ-JY; Fri, 19 Aug 2011 23:11:34 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1Quem1-0004XI-8B for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 23:11:13 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-8.tower-21.messagelabs.com!1313820657!55975328!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26144 invoked from network); 20 Aug 2011 06:10:57 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 20 Aug 2011 06:10:57 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Quely-00060g-7L for xen-changelog@lists.xensource.com; Sat, 20 Aug 2011 07:11:10 +0100 Message-Id: Date: Sat, 20 Aug 2011 07:11:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86/KEXEC: disable hpet legacy broadcasts earlier X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Andrew Cooper # Date 1313744302 -3600 # Node ID 0ddb4481f883ddf55c12a0b8d1445cf137ef0b63 # Parent 9957bef3e7b4511f83ed8883cd5ecd49ea3ee95d x86/KEXEC: disable hpet legacy broadcasts earlier On x2apic machines which booted in xapic mode, hpet_disable_legacy_broadcast() sends an event check IPI to all online processors. This leads to a protection fault as the genapic blindly pokes x2apic MSRs while the local apic is in xapic mode. One option is to change genapic when we shut down the local apic, but there are still problems with trying to IPI processors in the online processor map which are actually sitting in NMI loops Another option is to have each CPU take itself out of the online CPU map during the NMI shootdown. Realistically however, disabling hpet legacy broadcasts earlier in the kexec path is the easiest fix to the problem. Signed-off-by: Andrew Cooper --- diff -r 9957bef3e7b4 -r 0ddb4481f883 xen/arch/x86/crash.c --- a/xen/arch/x86/crash.c Fri Aug 19 09:57:42 2011 +0100 +++ b/xen/arch/x86/crash.c Fri Aug 19 09:58:22 2011 +0100 @@ -29,6 +29,7 @@ #include #include #include +#include static atomic_t waiting_for_crash_ipi; static unsigned int crashing_cpu; @@ -61,6 +62,9 @@ local_irq_disable(); + if ( hpet_broadcast_is_available() ) + hpet_disable_legacy_broadcast(); + crashing_cpu = smp_processor_id(); local_irq_count(crashing_cpu) = 0; diff -r 9957bef3e7b4 -r 0ddb4481f883 xen/arch/x86/machine_kexec.c --- a/xen/arch/x86/machine_kexec.c Fri Aug 19 09:57:42 2011 +0100 +++ b/xen/arch/x86/machine_kexec.c Fri Aug 19 09:58:22 2011 +0100 @@ -85,9 +85,6 @@ .limit = LAST_RESERVED_GDT_BYTE }; - if ( hpet_broadcast_is_available() ) - hpet_disable_legacy_broadcast(); - /* We are about to permenantly jump out of the Xen context into the kexec * purgatory code. We really dont want to be still servicing interupts. */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 23:11:46 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 23:11:46 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QuemY-0004hn-EP; Fri, 19 Aug 2011 23:11:46 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1Quem1-0004XB-1Q for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 23:11:14 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-12.tower-174.messagelabs.com!1313820669!28541798!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 22660 invoked from network); 20 Aug 2011 06:11:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 20 Aug 2011 06:11:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Quelx-00060R-OC for xen-changelog@lists.xensource.com; Sat, 20 Aug 2011 07:11:09 +0100 Message-Id: Date: Sat, 20 Aug 2011 07:11:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] mini-os: work around ld bug causing stupid CTOR count X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jeremy Fitzhardinge # Date 1313744262 -3600 # Node ID 9957bef3e7b4511f83ed8883cd5ecd49ea3ee95d # Parent e35c5202625ef5534561f84352833ad9467d986c mini-os: work around ld bug causing stupid CTOR count I'm seeing pvgrub crashing when running CTORs. It appears its because the magic in the linker script is generating junk. If I get ld to output a map, I see: .ctors 0x0000000000097000 0x18 0x0000000000097000 __CTOR_LIST__ = . 0x0000000000097000 0x4 LONG 0x25c04 (((__CTOR_END__ - __CTOR_LIST__) / 0x4) - 0x2) *(.ctors) .ctors 0x0000000000097004 0x10 /home/jeremy/hg/xen/unstable/stubdom/mini-os-x86_32-grub/mini-os.o 0x0000000000097014 0x4 LONG 0x0 0x0000000000097018 __CTOR_END__ = . In other words, somehow ((0x97018-0x97000) / 4) - 2 = 0x25c04 The specific crash is that the ctor loop tries to call the NULL sentinel. I'm seeing the same with the DTOR list. Avoid this by terminating the loop with the NULL sentinel, and get rid of the CTOR count entirely. From: Jeremy Fitzhardinge Signed-off-by: Keir Fraser --- diff -r e35c5202625e -r 9957bef3e7b4 extras/mini-os/arch/ia64/minios-ia64.lds --- a/extras/mini-os/arch/ia64/minios-ia64.lds Fri Aug 19 09:55:20 2011 +0100 +++ b/extras/mini-os/arch/ia64/minios-ia64.lds Fri Aug 19 09:57:42 2011 +0100 @@ -55,7 +55,6 @@ .ctors : AT(ADDR(.ctors) - (((5<<(61))+0x100000000) - (1 << 20))) { __CTOR_LIST__ = .; - QUAD((__CTOR_END__ - __CTOR_LIST__) / 8 - 2) *(.ctors) CONSTRUCTORS QUAD(0) @@ -65,7 +64,6 @@ .dtors : AT(ADDR(.dtors) - (((5<<(61))+0x100000000) - (1 << 20))) { __DTOR_LIST__ = .; - QUAD((__DTOR_END__ - __DTOR_LIST__) / 8 - 2) *(.dtors) QUAD(0) __DTOR_END__ = .; diff -r e35c5202625e -r 9957bef3e7b4 extras/mini-os/arch/x86/minios-x86_32.lds --- a/extras/mini-os/arch/x86/minios-x86_32.lds Fri Aug 19 09:55:20 2011 +0100 +++ b/extras/mini-os/arch/x86/minios-x86_32.lds Fri Aug 19 09:57:42 2011 +0100 @@ -30,7 +30,6 @@ .ctors : { __CTOR_LIST__ = .; - LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) *(.ctors) CONSTRUCTORS LONG(0) @@ -39,7 +38,6 @@ .dtors : { __DTOR_LIST__ = .; - LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) *(.dtors) LONG(0) __DTOR_END__ = .; diff -r e35c5202625e -r 9957bef3e7b4 extras/mini-os/arch/x86/minios-x86_64.lds --- a/extras/mini-os/arch/x86/minios-x86_64.lds Fri Aug 19 09:55:20 2011 +0100 +++ b/extras/mini-os/arch/x86/minios-x86_64.lds Fri Aug 19 09:57:42 2011 +0100 @@ -30,7 +30,6 @@ .ctors : { __CTOR_LIST__ = .; - QUAD((__CTOR_END__ - __CTOR_LIST__) / 8 - 2) *(.ctors) CONSTRUCTORS QUAD(0) @@ -39,7 +38,6 @@ .dtors : { __DTOR_LIST__ = .; - QUAD((__DTOR_END__ - __DTOR_LIST__) / 8 - 2) *(.dtors) QUAD(0) __DTOR_END__ = .; diff -r e35c5202625e -r 9957bef3e7b4 extras/mini-os/main.c --- a/extras/mini-os/main.c Fri Aug 19 09:55:20 2011 +0100 +++ b/extras/mini-os/main.c Fri Aug 19 09:57:42 2011 +0100 @@ -153,7 +153,7 @@ __libc_init_array(); environ = envp; - for (i = 1; i <= __CTOR_LIST__[0]; i++) + for (i = 0; __CTOR_LIST__[i] != 0; i++) ((void((*)(void)))__CTOR_LIST__[i]) (); tzset(); @@ -164,7 +164,7 @@ { int i; - for (i = 1; i <= __DTOR_LIST__[0]; i++) + for (i = 0; __DTOR_LIST__[i] != 0; i++) ((void((*)(void)))__DTOR_LIST__[i]) (); close_all_files(); __libc_fini_array(); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 23:11:56 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 23:11:56 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Quemi-0004km-0W; Fri, 19 Aug 2011 23:11:56 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1Quelz-0004WY-TZ for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 23:11:14 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-21.messagelabs.com!1313820638!57221798!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8534 invoked from network); 20 Aug 2011 06:10:38 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 20 Aug 2011 06:10:38 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Quelw-0005zx-P8 for xen-changelog@lists.xensource.com; Sat, 20 Aug 2011 07:11:08 +0100 Message-Id: Date: Sat, 20 Aug 2011 07:11:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: trampoline cleanup X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313744093 -3600 # Node ID dd90b59cb11c60c48e174c899190e2967341fe32 # Parent 29aeed4979a78f26519f5fde8a405f8438297ab9 x86: trampoline cleanup To make future changes less error prone, and to slightly simplify a possible future conversion to a relocatable trampoline even for the multiboot path (pretty desirable given that we had to change the trampoline base a number of times to escape collisions with firmware placed data), - remove final uses of bootsym_phys() from trampoline.S, allowing the symbol to be undefined before including this file (to make sure no new references get added) - replace two easy to deal with uses of bootsym_phys() in head.S - remove an easy to replace reference to BOOT_TRAMPOLINE Signed-off-by: Jan Beulich --- diff -r 29aeed4979a7 -r dd90b59cb11c xen/arch/x86/boot/head.S --- a/xen/arch/x86/boot/head.S Fri Aug 19 09:54:26 2011 +0100 +++ b/xen/arch/x86/boot/head.S Fri Aug 19 09:54:53 2011 +0100 @@ -202,11 +202,11 @@ /* Copy bootstrap trampoline to low memory, below 1MB. */ mov $sym_phys(trampoline_start),%esi - mov $bootsym_phys(trampoline_start),%edi + mov %edx,%edi mov $trampoline_end - trampoline_start,%ecx rep movsb - mov $bootsym_phys(early_stack),%esp + lea early_stack-trampoline_start(%edx),%esp call cmdline_parse_early /* Jump into the relocated trampoline. */ @@ -214,6 +214,8 @@ #include "cmdline.S" +#undef bootsym_phys + reloc: #include "reloc.S" diff -r 29aeed4979a7 -r dd90b59cb11c xen/arch/x86/boot/trampoline.S --- a/xen/arch/x86/boot/trampoline.S Fri Aug 19 09:54:26 2011 +0100 +++ b/xen/arch/x86/boot/trampoline.S Fri Aug 19 09:54:53 2011 +0100 @@ -132,7 +132,7 @@ .code32 trampoline_boot_cpu_entry: - cmpb $0,bootsym_phys(skip_realmode) + cmpb $0,bootsym_rel(skip_realmode,5) jnz .Lskip_realmode /* Load pseudo-real-mode segments. */ @@ -152,7 +152,7 @@ /* Load proper real-mode values into %cs, %ds, %es and %ss. */ ljmp $(BOOT_TRAMPOLINE>>4),$bootsym(1f) -1: mov $(BOOT_TRAMPOLINE>>4),%ax +1: mov %cs,%ax mov %ax,%ds mov %ax,%es mov %ax,%ss @@ -195,7 +195,7 @@ lmsw %ax # CR0.PE = 1 (enter protected mode) /* Load proper protected-mode values into all segment registers. */ - ljmpl $BOOT_CS32,$bootsym_phys(1f) + ljmpl $BOOT_CS32,$bootsym_rel(1f,6) .code32 1: mov $BOOT_DS,%eax mov %eax,%ds _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 23:12:05 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 23:12:05 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Quemr-0004oS-52; Fri, 19 Aug 2011 23:12:05 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1Quelz-0004WQ-NB for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 23:11:13 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-7.tower-216.messagelabs.com!1313820668!15383229!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 17410 invoked from network); 20 Aug 2011 06:11:08 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 20 Aug 2011 06:11:08 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Quelw-0005zi-9A for xen-changelog@lists.xensource.com; Sat, 20 Aug 2011 07:11:08 +0100 Message-Id: Date: Sat, 20 Aug 2011 07:11:07 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: make run-time part of trampoline relocatable X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1313744066 -3600 # Node ID 29aeed4979a78f26519f5fde8a405f8438297ab9 # Parent fc2be6cb89ad49efd90fe1b650f7efaab72f61b2 x86: make run-time part of trampoline relocatable In order to eliminate an initial hack in the EFI boot code (where memory for the trampoline was just "claimed" instead of properly allocated), the trampoline code must no longer make assumption on the address at which it would be located. For the time being, the fixed address is being retained for the traditional multiboot path. As an additional benefit (at least from my pov) it allows confining the visibility of the BOOT_TRAMPOLINE definition to just the boot code. Signed-off-by: Jan Beulich --- diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/boot/Makefile --- a/xen/arch/x86/boot/Makefile Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/boot/Makefile Fri Aug 19 09:54:26 2011 +0100 @@ -2,8 +2,8 @@ head.o: reloc.S -BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\{1\,\}BOOT_TRAMPOLINE[[:space:]]\{1\,\},,p' $(BASEDIR)/include/asm-x86/config.h) +BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\{1\,\}BOOT_TRAMPOLINE[[:space:]]\{1\,\},,p' head.S) %.S: %.c RELOC=$(BOOT_TRAMPOLINE) $(MAKE) -f build32.mk $@ -reloc.S: $(BASEDIR)/include/asm-x86/config.h +reloc.S: head.S diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/boot/head.S --- a/xen/arch/x86/boot/head.S Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/boot/head.S Fri Aug 19 09:54:26 2011 +0100 @@ -9,7 +9,7 @@ .text .code32 -#undef bootsym_phys +#define BOOT_TRAMPOLINE 0x7c000 #define sym_phys(sym) ((sym) - __XEN_VIRT_START) #define bootsym_phys(sym) ((sym) - trampoline_start + BOOT_TRAMPOLINE) @@ -189,6 +189,17 @@ mov %edi,sym_phys(idle_pg_table_l2) + (__PAGE_OFFSET>>18) #endif + /* Apply relocations to bootstrap trampoline. */ + mov $BOOT_TRAMPOLINE,%edx + mov $sym_phys(__trampoline_rel_start),%edi + mov %edx,sym_phys(trampoline_phys) +1: + mov (%edi),%eax + add %edx,(%edi,%eax) + add $4,%edi + cmp $sym_phys(__trampoline_rel_stop),%edi + jb 1b + /* Copy bootstrap trampoline to low memory, below 1MB. */ mov $sym_phys(trampoline_start),%esi mov $bootsym_phys(trampoline_start),%edi diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/boot/trampoline.S --- a/xen/arch/x86/boot/trampoline.S Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/boot/trampoline.S Fri Aug 19 09:54:26 2011 +0100 @@ -4,6 +4,13 @@ #undef bootsym #define bootsym(s) ((s)-trampoline_start) +#define bootsym_rel(sym, off, opnd...) \ + bootsym(sym),##opnd; \ +111:; \ + .pushsection .trampoline_rel, "a"; \ + .long 111b - (off) - .; \ + .popsection + .globl trampoline_realmode_entry trampoline_realmode_entry: mov %cs,%ax @@ -17,11 +24,11 @@ xor %ax, %ax inc %ax lmsw %ax # CR0.PE = 1 (enter protected mode) - ljmpl $BOOT_CS32,$bootsym_phys(trampoline_protmode_entry) + ljmpl $BOOT_CS32,$bootsym_rel(trampoline_protmode_entry,6) idt_48: .word 0, 0, 0 # base = limit = 0 gdt_48: .word 6*8-1 - .long bootsym_phys(trampoline_gdt) + .long bootsym_rel(trampoline_gdt,4) trampoline_gdt: /* 0x0000: unused */ .quad 0x0000000000000000 @@ -32,11 +39,16 @@ /* 0x0018: ring 0 data */ .quad 0x00cf92000000ffff /* 0x0020: real-mode code @ BOOT_TRAMPOLINE */ - .long 0x0000ffff | ((BOOT_TRAMPOLINE & 0x00ffff) << 16) - .long 0x00009a00 | ((BOOT_TRAMPOLINE & 0xff0000) >> 16) + .long 0x0000ffff + .long 0x00009a00 /* 0x0028: real-mode data @ BOOT_TRAMPOLINE */ - .long 0x0000ffff | ((BOOT_TRAMPOLINE & 0x00ffff) << 16) - .long 0x00009200 | ((BOOT_TRAMPOLINE & 0xff0000) >> 16) + .long 0x0000ffff + .long 0x00009200 + + .pushsection .trampoline_rel, "a" + .long trampoline_gdt + BOOT_PSEUDORM_CS + 2 - . + .long trampoline_gdt + BOOT_PSEUDORM_DS + 2 - . + .popsection .globl cpuid_ext_features cpuid_ext_features: @@ -66,11 +78,11 @@ /* Load pagetable base register. */ mov $sym_phys(idle_pg_table),%eax - add bootsym_phys(trampoline_xen_phys_start),%eax + add bootsym_rel(trampoline_xen_phys_start,4,%eax) mov %eax,%cr3 /* Set up EFER (Extended Feature Enable Register). */ - mov bootsym_phys(cpuid_ext_features),%edi + mov bootsym_rel(cpuid_ext_features,4,%edi) test $0x20100800,%edi /* SYSCALL/SYSRET, No Execute, Long Mode? */ jz .Lskip_efer movl $MSR_EFER,%ecx @@ -93,7 +105,7 @@ #if defined(__x86_64__) /* Now in compatibility mode. Long-jump into 64-bit mode. */ - ljmp $BOOT_CS64,$bootsym_phys(start64) + ljmp $BOOT_CS64,$bootsym_rel(start64,6) .code64 start64: diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/boot/wakeup.S --- a/xen/arch/x86/boot/wakeup.S Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/boot/wakeup.S Fri Aug 19 09:54:26 2011 +0100 @@ -42,15 +42,13 @@ # boot trampoline is under 1M, and shift its start into # %fs to reference symbols in that area - movl $BOOT_TRAMPOLINE, %eax - shrl $4, %eax - movl %eax, %fs + mov wakesym(trampoline_seg), %fs lidt %fs:bootsym(idt_48) lgdt %fs:bootsym(gdt_48) movw $1, %ax lmsw %ax # Turn on CR0.PE - ljmpl $BOOT_CS32, $bootsym_phys(wakeup_32) + ljmpl $BOOT_CS32, $bootsym_rel(wakeup_32, 6) /* This code uses an extended set of video mode numbers. These include: * Aliases for standard modes @@ -103,6 +101,10 @@ .globl video_mode, video_flags video_mode: .long 0 video_flags: .long 0 +trampoline_seg: .word BOOT_TRAMPOLINE >> 4 + .pushsection .trampoline_seg, "a" + .long trampoline_seg - . + .popsection .code32 @@ -114,11 +116,11 @@ mov $BOOT_DS, %eax mov %eax, %ds mov %eax, %ss - mov $bootsym_phys(early_stack), %esp + mov $bootsym_rel(early_stack, 4, %esp) # check saved magic again mov $sym_phys(saved_magic), %eax - add bootsym_phys(trampoline_xen_phys_start), %eax + add bootsym_rel(trampoline_xen_phys_start, 4, %eax) mov (%eax), %eax cmp $0x9abcdef0, %eax jne bogus_saved_magic @@ -131,12 +133,12 @@ /* Load pagetable base register */ mov $sym_phys(idle_pg_table),%eax - add bootsym_phys(trampoline_xen_phys_start),%eax + add bootsym_rel(trampoline_xen_phys_start,4,%eax) mov %eax,%cr3 /* Will cpuid feature change after resume? */ /* Set up EFER (Extended Feature Enable Register). */ - mov bootsym_phys(cpuid_ext_features),%edi + mov bootsym_rel(cpuid_ext_features,4,%edi) test $0x20100800,%edi /* SYSCALL/SYSRET, No Execute, Long Mode? */ jz .Lskip_eferw movl $MSR_EFER,%ecx @@ -162,7 +164,7 @@ #if defined(__x86_64__) /* Now in compatibility mode. Long-jump to 64-bit mode */ - ljmp $BOOT_CS64, $bootsym_phys(wakeup_64) + ljmp $BOOT_CS64, $bootsym_rel(wakeup_64,6) .code64 wakeup_64: diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/efi/boot.c --- a/xen/arch/x86/efi/boot.c Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/efi/boot.c Fri Aug 19 09:54:26 2011 +0100 @@ -599,6 +599,9 @@ } } +extern const s32 __trampoline_rel_start[], __trampoline_rel_stop[]; +extern const s32 __trampoline_seg_start[], __trampoline_seg_stop[]; + void EFIAPI __init __attribute__((__noreturn__)) efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { @@ -614,9 +617,10 @@ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info; EFI_FILE_HANDLE dir_handle; union string section = { NULL }, name; + const s32 *trampoline_ptr; struct e820entry *e; u64 efer; - bool_t base_video = 0, trampoline_okay = 0; + bool_t base_video = 0; efi_ih = ImageHandle; efi_bs = SystemTable->BootServices; @@ -914,15 +918,27 @@ dmi_efi_get_table((void *)(long)efi.smbios); /* Allocate space for trampoline (in first Mb). */ - cfg.addr = BOOT_TRAMPOLINE; + cfg.addr = 0x100000; cfg.size = trampoline_end - trampoline_start; - status = efi_bs->AllocatePages(AllocateAddress, EfiLoaderData, + status = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData, PFN_UP(cfg.size), &cfg.addr); if ( EFI_ERROR(status) ) { cfg.addr = 0; - PrintErr(L"Note: Trampoline area is in use\r\n"); + blexit(L"No memory for trampoline\r\n"); } + trampoline_phys = cfg.addr; + /* Apply relocations to trampoline. */ + for ( trampoline_ptr = __trampoline_rel_start; + trampoline_ptr < __trampoline_rel_stop; + ++trampoline_ptr ) + *(u32 *)(*trampoline_ptr + (long)trampoline_ptr) += + trampoline_phys; + for ( trampoline_ptr = __trampoline_seg_start; + trampoline_ptr < __trampoline_seg_stop; + ++trampoline_ptr ) + *(u16 *)(*trampoline_ptr + (long)trampoline_ptr) = + trampoline_phys >> 4; /* Initialise L2 identity-map and xen page table entries (16MB). */ for ( i = 0; i < 8; ++i ) @@ -1096,14 +1112,8 @@ e->type = type; ++e820nr; } - if ( type == E820_RAM && e->addr <= BOOT_TRAMPOLINE && - e->addr + e->size >= BOOT_TRAMPOLINE + cfg.size ) - trampoline_okay = 1; } - if ( !trampoline_okay ) - blexit(L"Trampoline area unavailable\r\n"); - status = efi_bs->ExitBootServices(ImageHandle, map_key); if ( EFI_ERROR(status) ) PrintErrMesg(L"Cannot exit boot services", status); @@ -1117,7 +1127,7 @@ efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START; relocate_image(__XEN_VIRT_START - xen_phys_start); - memcpy((void *)(long)BOOT_TRAMPOLINE, trampoline_start, cfg.size); + memcpy((void *)trampoline_phys, trampoline_start, cfg.size); /* Set system registers and transfer control. */ asm volatile("pushq $0\n\tpopfq"); diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/smpboot.c --- a/xen/arch/x86/smpboot.c Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/smpboot.c Fri Aug 19 09:54:26 2011 +0100 @@ -48,6 +48,8 @@ #define setup_trampoline() (bootsym_phys(trampoline_realmode_entry)) +unsigned long __read_mostly trampoline_phys; + /* representing HT siblings of each logical CPU */ DEFINE_PER_CPU_READ_MOSTLY(cpumask_t, cpu_sibling_map); /* representing HT and core siblings of each logical CPU */ diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/x86_32/mm.c --- a/xen/arch/x86/x86_32/mm.c Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/x86_32/mm.c Fri Aug 19 09:54:26 2011 +0100 @@ -166,8 +166,9 @@ flush_all(FLUSH_TLB_GLOBAL); /* Replace with mapping of the boot trampoline only. */ - map_pages_to_xen(BOOT_TRAMPOLINE, BOOT_TRAMPOLINE >> PAGE_SHIFT, - 0x10, __PAGE_HYPERVISOR); + map_pages_to_xen(trampoline_phys, trampoline_phys >> PAGE_SHIFT, + PFN_UP(trampoline_end - trampoline_start), + __PAGE_HYPERVISOR); } void __init subarch_init_memory(void) diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/x86_64/mm.c --- a/xen/arch/x86/x86_64/mm.c Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/x86_64/mm.c Fri Aug 19 09:54:26 2011 +0100 @@ -829,7 +829,7 @@ flush_local(FLUSH_TLB_GLOBAL); /* Replace with mapping of the boot trampoline only. */ - map_pages_to_xen(BOOT_TRAMPOLINE, BOOT_TRAMPOLINE >> PAGE_SHIFT, + map_pages_to_xen(trampoline_phys, trampoline_phys >> PAGE_SHIFT, PFN_UP(trampoline_end - trampoline_start), __PAGE_HYPERVISOR); } diff -r fc2be6cb89ad -r 29aeed4979a7 xen/arch/x86/xen.lds.S --- a/xen/arch/x86/xen.lds.S Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/arch/x86/xen.lds.S Fri Aug 19 09:54:26 2011 +0100 @@ -103,6 +103,13 @@ *(.init.data) *(.init.data.rel) *(.init.data.rel.*) + . = ALIGN(4); + __trampoline_rel_start = .; + *(.trampoline_rel) + __trampoline_rel_stop = .; + __trampoline_seg_start = .; + *(.trampoline_seg) + __trampoline_seg_stop = .; } :text . = ALIGN(32); .init.setup : { diff -r fc2be6cb89ad -r 29aeed4979a7 xen/include/asm-x86/config.h --- a/xen/include/asm-x86/config.h Tue Aug 16 15:05:55 2011 +0100 +++ b/xen/include/asm-x86/config.h Fri Aug 19 09:54:26 2011 +0100 @@ -95,13 +95,13 @@ /* Primary stack is restricted to 8kB by guard pages. */ #define PRIMARY_STACK_SIZE 8192 -#define BOOT_TRAMPOLINE 0x7c000 +#ifndef __ASSEMBLY__ +extern unsigned long trampoline_phys; #define bootsym_phys(sym) \ - (((unsigned long)&(sym)-(unsigned long)&trampoline_start)+BOOT_TRAMPOLINE) + (((unsigned long)&(sym)-(unsigned long)&trampoline_start)+trampoline_phys) #define bootsym(sym) \ (*RELOC_HIDE((typeof(&(sym)))__va(__pa(&(sym))), \ - BOOT_TRAMPOLINE-__pa(trampoline_start))) -#ifndef __ASSEMBLY__ + trampoline_phys-__pa(trampoline_start))) extern char trampoline_start[], trampoline_end[]; extern char trampoline_realmode_entry[]; extern unsigned int trampoline_xen_phys_start; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 23:12:14 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 23:12:14 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Quemz-0004rW-LC; Fri, 19 Aug 2011 23:12:13 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1Quem1-0004XW-Nl for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 23:11:14 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-2.tower-216.messagelabs.com!1313820670!15369150!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 22769 invoked from network); 20 Aug 2011 06:11:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 20 Aug 2011 06:11:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Quely-00060v-N8 for xen-changelog@lists.xensource.com; Sat, 20 Aug 2011 07:11:10 +0100 Message-Id: Date: Sat, 20 Aug 2011 07:11:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] nestedhvm: do not send IPIs twice X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1313756965 -3600 # Node ID e86b85dc682050e08aadb0e1618cbc30c39a5469 # Parent 0ddb4481f883ddf55c12a0b8d1445cf137ef0b63 nestedhvm: do not send IPIs twice In p2m_get_nestedp2m() there is no need to send IPIs via nestedhvm_vmcx_flushtlb() since p2m_flush_table() already did that. Signed-off-by: Christoph Egger Committed-by: Tim Deegan --- diff -r 0ddb4481f883 -r e86b85dc6820 xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Fri Aug 19 09:58:22 2011 +0100 +++ b/xen/arch/x86/mm/p2m.c Fri Aug 19 13:29:25 2011 +0100 @@ -1164,7 +1164,6 @@ p2m->cr3 = cr3; nv->nv_flushp2m = 0; hvm_asid_flush_vcpu(v); - nestedhvm_vmcx_flushtlb(p2m); cpu_set(v->processor, p2m->p2m_dirty_cpumask); p2m_unlock(p2m); nestedp2m_unlock(d); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Fri Aug 19 23:12:22 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Fri, 19 Aug 2011 23:12:22 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Quen8-0004ui-Gl; Fri, 19 Aug 2011 23:12:22 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1Quem2-0004Xk-8b for xen-changelog@lists.xensource.com; Fri, 19 Aug 2011 23:11:15 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-6.tower-216.messagelabs.com!1313820671!14122874!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 1901 invoked from network); 20 Aug 2011 06:11:11 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 20 Aug 2011 06:11:11 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Quelz-00061A-7Q for xen-changelog@lists.xensource.com; Sat, 20 Aug 2011 07:11:11 +0100 Message-Id: Date: Sat, 20 Aug 2011 07:11:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] nestedhvm: avoid endless loop of nested page faults X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1313756967 -3600 # Node ID 7ba9270b127bd9935eec769373c37bb344c351b2 # Parent e86b85dc682050e08aadb0e1618cbc30c39a5469 nestedhvm: avoid endless loop of nested page faults Stop sending IPIs to flush the nested-on-nested pagetable after write operations. Instead flush the TLB only. This fixes an endless loop of nested page faults after adding an entry to the nested-on-nested pagetable. Signed-off-by: Christoph Egger Committed-by: Tim Deegan --- diff -r e86b85dc6820 -r 7ba9270b127b xen/arch/x86/mm/hap/nested_hap.c --- a/xen/arch/x86/mm/hap/nested_hap.c Fri Aug 19 13:29:25 2011 +0100 +++ b/xen/arch/x86/mm/hap/nested_hap.c Fri Aug 19 13:29:27 2011 +0100 @@ -86,8 +86,9 @@ old_flags = l1e_get_flags(*p); safe_write_pte(p, new); + if (old_flags & _PAGE_PRESENT) - nestedhvm_vmcx_flushtlb(p2m); + flush_tlb_mask(&p2m->p2m_dirty_cpumask); paging_unlock(d); } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 22 07:33:13 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 22 Aug 2011 07:33:13 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVYv-00083P-K8; Mon, 22 Aug 2011 07:33:13 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVYt-00082n-Jo for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 07:33:11 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-13.tower-216.messagelabs.com!1314023588!15573649!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 7274 invoked from network); 22 Aug 2011 14:33:08 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 22 Aug 2011 14:33:08 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QvVYq-0002Zr-Dy for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 15:33:08 +0100 Message-Id: Date: Mon, 22 Aug 2011 15:33:07 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: use 'dom0_mem' to limit the number of pages for dom0 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User David Vrabel # Date 1314003927 -3600 # Node ID c56dd5eb0fa2f6623cf198998373bbb24dd6142c # Parent 7ba9270b127bd9935eec769373c37bb344c351b2 x86: use 'dom0_mem' to limit the number of pages for dom0 Use the 'dom0_mem' command line option to set the maximum number of pages for dom0. dom0 can use then use the XENMEM_maximum_reservation memory op to automatically find this limit and reduce the size of any page tables etc. Signed-off-by: David Vrabel --- diff -r 7ba9270b127b -r c56dd5eb0fa2 xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Fri Aug 19 13:29:27 2011 +0100 +++ b/xen/arch/x86/domain_build.c Mon Aug 22 10:05:27 2011 +0100 @@ -254,6 +254,8 @@ } #endif + d->max_pages = min(max_pages, avail); + return nr_pages; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 22 07:33:26 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 22 Aug 2011 07:33:26 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVZ6-00086q-Dl; Mon, 22 Aug 2011 07:33:25 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVYv-00082q-Rn for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 07:33:16 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-11.tower-174.messagelabs.com!1314023589!28737407!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 7581 invoked from network); 22 Aug 2011 14:33:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 22 Aug 2011 14:33:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QvVYq-0002a6-Vh for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 15:33:08 +0100 Message-Id: Date: Mon, 22 Aug 2011 15:33:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: remove iommu tlb flush for non-present entries X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Wei Wang # Date 1314004204 -3600 # Node ID 07f78b5bd03c02e32324eaa00487643d27b7ffa8 # Parent c56dd5eb0fa2f6623cf198998373bbb24dd6142c AMD IOMMU: remove iommu tlb flush for non-present entries Fixes dom0 boot on some systems. Signed-off-by: Wei Wang --- diff -r c56dd5eb0fa2 -r 07f78b5bd03c xen/drivers/passthrough/amd/iommu_map.c --- a/xen/drivers/passthrough/amd/iommu_map.c Mon Aug 22 10:05:27 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_map.c Mon Aug 22 10:10:04 2011 +0100 @@ -796,7 +796,10 @@ if ( !need_flush ) goto out; - amd_iommu_flush_pages(d, gfn, 0); + /* 4K mapping for PV guests never changes, + * no need to flush if we trust non-present bits */ + if ( is_hvm_domain(d) ) + amd_iommu_flush_pages(d, gfn, 0); for ( merge_level = IOMMU_PAGING_MODE_LEVEL_2; merge_level <= hd->paging_mode; merge_level++ ) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 22 07:33:34 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 22 Aug 2011 07:33:34 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVZG-0008A7-A4; Mon, 22 Aug 2011 07:33:34 -0700 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVYz-00083w-3y for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 07:33:17 -0700 Received: from [85.158.139.83:58393] by server-1.bemta-5.messagelabs.com id E0/E6-30540-BA8625E4; Mon, 22 Aug 2011 14:33:15 +0000 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-5.tower-182.messagelabs.com!1314023595!10452598!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 4391 invoked from network); 22 Aug 2011 14:33:15 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 22 Aug 2011 14:33:15 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QvVYx-0002ab-9v for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 15:33:15 +0100 Message-Id: Date: Mon, 22 Aug 2011 15:33:14 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86/IO-APIC: clear remoteIRR in clear_IO_APIC_pin() X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1314004270 -3600 # Node ID 25dfe53bb1898b3967ceb71a7eb60a8b760c25fb # Parent 0849b0e59e2418e8215616df147f955b01b07577 x86/IO-APIC: clear remoteIRR in clear_IO_APIC_pin() It was found that in a crash scenario, the remoteIRR bit in an IO-APIC RTE could be left set, causing problems when bringing up a kdump kernel. While this generally is most important to be taken care of in the new kernel (which usually would be a native one), it still seems desirable to also address this problem in Xen so that (a) the problem doesn't bite Xen when used as a secondary emergency kernel and (b) an attempt is being made to save un-fixed secondary kernels from running into said problem. Based on a Linux patch from suresh.b.siddha@intel.com. Signed-off-by: Jan Beulich --- diff -r 0849b0e59e24 -r 25dfe53bb189 xen/arch/x86/io_apic.c --- a/xen/arch/x86/io_apic.c Mon Aug 22 10:10:39 2011 +0100 +++ b/xen/arch/x86/io_apic.c Mon Aug 22 10:11:10 2011 +0100 @@ -382,11 +382,46 @@ return; /* + * Make sure the entry is masked and re-read the contents to check + * if it is a level triggered pin and if the remoteIRR is set. + */ + if (!entry.mask) { + entry.mask = 1; + __ioapic_write_entry(apic, pin, FALSE, entry); + } + entry = __ioapic_read_entry(apic, pin, TRUE); + + if (entry.irr) { + /* Make sure the trigger mode is set to level. */ + if (!entry.trigger) { + entry.trigger = 1; + __ioapic_write_entry(apic, pin, TRUE, entry); + } + if (mp_ioapics[apic].mpc_apicver >= 0x20) + io_apic_eoi(apic, entry.vector); + else { + /* + * Mechanism by which we clear remoteIRR in this case is by + * changing the trigger mode to edge and back to level. + */ + entry.trigger = 0; + __ioapic_write_entry(apic, pin, TRUE, entry); + entry.trigger = 1; + __ioapic_write_entry(apic, pin, TRUE, entry); + } + } + + /* * Disable it in the IO-APIC irq-routing table: */ memset(&entry, 0, sizeof(entry)); entry.mask = 1; __ioapic_write_entry(apic, pin, TRUE, entry); + + entry = __ioapic_read_entry(apic, pin, TRUE); + if (entry.irr) + printk(KERN_ERR "IO-APIC%02x-%u: Unable to reset IRR\n", + IO_APIC_ID(apic), pin); } static void clear_IO_APIC (void) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 22 07:33:41 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 22 Aug 2011 07:33:41 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVZN-0008DE-EG; Mon, 22 Aug 2011 07:33:41 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVZ0-00083v-6V for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 07:33:18 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-7.tower-27.messagelabs.com!1314023576!45574209!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31348 invoked from network); 22 Aug 2011 14:32:57 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 22 Aug 2011 14:32:57 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QvVYw-0002aL-Pw for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 15:33:14 +0100 Message-Id: Date: Mon, 22 Aug 2011 15:33:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] pm: don't truncate processors' ACPI IDs to 8 bits X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1314004239 -3600 # Node ID 0849b0e59e2418e8215616df147f955b01b07577 # Parent 07f78b5bd03c02e32324eaa00487643d27b7ffa8 pm: don't truncate processors' ACPI IDs to 8 bits This is just another adjustment to allow systems with very many CPUs (or unusual ACPI IDs) to be properly power-managed. Signed-off-by: Jan Beulich --- diff -r 07f78b5bd03c -r 0849b0e59e24 xen/arch/ia64/linux-xen/acpi.c --- a/xen/arch/ia64/linux-xen/acpi.c Mon Aug 22 10:10:04 2011 +0100 +++ b/xen/arch/ia64/linux-xen/acpi.c Mon Aug 22 10:10:39 2011 +0100 @@ -221,11 +221,14 @@ {[0 ... MAX_LOCAL_SAPIC - 1] = 0xffff }; /* acpi id to cpu id */ -int get_cpu_id(u8 acpi_id) +int get_cpu_id(u32 acpi_id) { int i; u16 apic_id; + if ( acpi_id >= MAX_LOCAL_SAPIC ) + return -EINVAL; + apic_id = ia64_acpiid_to_sapicid[acpi_id]; if ( apic_id == 0xffff ) return -EINVAL; diff -r 07f78b5bd03c -r 0849b0e59e24 xen/arch/x86/acpi/cpu_idle.c --- a/xen/arch/x86/acpi/cpu_idle.c Mon Aug 22 10:10:04 2011 +0100 +++ b/xen/arch/x86/acpi/cpu_idle.c Mon Aug 22 10:10:39 2011 +0100 @@ -895,11 +895,14 @@ acpi_power->safe_state = cx; } -int get_cpu_id(u8 acpi_id) +int get_cpu_id(u32 acpi_id) { int i; u32 apic_id; + if ( acpi_id >= MAX_MADT_ENTRIES ) + return -1; + apic_id = x86_acpiid_to_apicid[acpi_id]; if ( apic_id == BAD_APICID ) return -1; @@ -976,7 +979,7 @@ print_cx_pminfo(cpu, power); /* map from acpi_id to cpu_id */ - cpu_id = get_cpu_id((u8)cpu); + cpu_id = get_cpu_id(cpu); if ( cpu_id == -1 ) { printk(XENLOG_ERR "no cpu_id for acpi_id %d\n", cpu); diff -r 07f78b5bd03c -r 0849b0e59e24 xen/include/acpi/cpufreq/processor_perf.h --- a/xen/include/acpi/cpufreq/processor_perf.h Mon Aug 22 10:10:04 2011 +0100 +++ b/xen/include/acpi/cpufreq/processor_perf.h Mon Aug 22 10:10:39 2011 +0100 @@ -6,7 +6,7 @@ #define XEN_PX_INIT 0x80000000 -int get_cpu_id(u8); +int get_cpu_id(u32); int powernow_cpufreq_init(void); unsigned int powernow_register_driver(void); unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 22 07:33:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 22 Aug 2011 07:33:50 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVZV-0008GD-Nd; Mon, 22 Aug 2011 07:33:49 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1QvVZ1-00083x-0R for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 07:33:19 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-27.messagelabs.com!1314023585!33042398!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25762 invoked from network); 22 Aug 2011 14:33:05 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 22 Aug 2011 14:33:05 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QvVYx-0002aq-Rc for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 15:33:15 +0100 Message-Id: Date: Mon, 22 Aug 2011 15:33:15 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] ACPI: add _PDC input override mechanism X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1314004356 -3600 # Node ID 2029263c501c315fa4d94845e5cfa6a9b0b395d5 # Parent 25dfe53bb1898b3967ceb71a7eb60a8b760c25fb ACPI: add _PDC input override mechanism In order to have Dom0 call _PDC with input fully representing Xen's capabilities, and in order to avoid building knowledge of Xen implementation details into Dom0, this provides a mechanism by which the Dom0 kernel can, once it filled the _PDC input buffer according to its own knowledge, present the buffer to Xen to apply overrides for the parts of the C-, P-, and T-state management that it controls. This is particularly to address the dependency of Xen using MWAIT to enter certain C-states on the availability of the break-on-interrupt extension (which the Dom0 kernel should have no need to know about). Signed-off-by: Jan Beulich --- diff -r 25dfe53bb189 -r 2029263c501c xen/arch/ia64/linux-xen/acpi.c --- a/xen/arch/ia64/linux-xen/acpi.c Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/arch/ia64/linux-xen/acpi.c Mon Aug 22 10:12:36 2011 +0100 @@ -241,6 +241,13 @@ return -1; } + +int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *pdc, u32 mask) +{ + pdc[2] |= ACPI_PDC_EST_CAPABILITY_SMP & mask; + return 0; +} + #endif static int __init diff -r 25dfe53bb189 -r 2029263c501c xen/arch/x86/acpi/cpu_idle.c --- a/xen/arch/x86/acpi/cpu_idle.c Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/arch/x86/acpi/cpu_idle.c Mon Aug 22 10:12:36 2011 +0100 @@ -643,12 +643,6 @@ return 0; } -#define CPUID_MWAIT_LEAF (5) -#define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1) -#define CPUID5_ECX_INTERRUPT_BREAK (0x2) - -#define MWAIT_ECX_INTERRUPT_BREAK (0x1) - #define MWAIT_SUBSTATE_MASK (0xf) #define MWAIT_SUBSTATE_SIZE (4) diff -r 25dfe53bb189 -r 2029263c501c xen/arch/x86/acpi/lib.c --- a/xen/arch/x86/acpi/lib.c Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/arch/x86/acpi/lib.c Mon Aug 22 10:12:36 2011 +0100 @@ -81,3 +81,47 @@ return INVALID_ACPIID; } + +static void get_mwait_ecx(void *info) +{ + *(u32 *)info = cpuid_ecx(CPUID_MWAIT_LEAF); +} + +int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *pdc, u32 mask) +{ + unsigned int cpu = get_cpu_id(acpi_id); + struct cpuinfo_x86 *c; + u32 ecx; + + if (!(acpi_id + 1)) + c = &boot_cpu_data; + else if (cpu >= NR_CPUS || !cpu_online(cpu)) + return -EINVAL; + else + c = cpu_data + cpu; + + pdc[2] |= ACPI_PDC_C_CAPABILITY_SMP & mask; + + if (cpu_has(c, X86_FEATURE_EST)) + pdc[2] |= ACPI_PDC_EST_CAPABILITY_SWSMP & mask; + + if (cpu_has(c, X86_FEATURE_ACPI)) + pdc[2] |= ACPI_PDC_T_FFH & mask; + + /* + * If mwait/monitor or its break-on-interrupt extension are + * unsupported, Cx_FFH will be disabled. + */ + if (!cpu_has(c, X86_FEATURE_MWAIT) || + c->cpuid_level < CPUID_MWAIT_LEAF) + ecx = 0; + else if (c == &boot_cpu_data || cpu == smp_processor_id()) + ecx = cpuid_ecx(CPUID_MWAIT_LEAF); + else + on_selected_cpus(cpumask_of(cpu), get_mwait_ecx, &ecx, 1); + if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) || + !(ecx & CPUID5_ECX_INTERRUPT_BREAK)) + pdc[2] &= ~(ACPI_PDC_C_C1_FFH | ACPI_PDC_C_C2C3_FFH); + + return 0; +} diff -r 25dfe53bb189 -r 2029263c501c xen/arch/x86/platform_hypercall.c --- a/xen/arch/x86/platform_hypercall.c Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/arch/x86/platform_hypercall.c Mon Aug 22 10:12:36 2011 +0100 @@ -415,6 +415,15 @@ ret = -EINVAL; break; + case XEN_PM_PDC: + { + XEN_GUEST_HANDLE(uint32) pdc; + + guest_from_compat_handle(pdc, op->u.set_pminfo.u.pdc); + ret = acpi_set_pdc_bits(op->u.set_pminfo.id, pdc); + } + break; + default: ret = -EINVAL; break; diff -r 25dfe53bb189 -r 2029263c501c xen/drivers/acpi/pmstat.c --- a/xen/drivers/acpi/pmstat.c Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/drivers/acpi/pmstat.c Mon Aug 22 10:12:36 2011 +0100 @@ -517,3 +517,34 @@ return ret; } + +int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE(uint32) pdc) +{ + u32 bits[3]; + int ret; + + if ( copy_from_guest(bits, pdc, 2) ) + ret = -EFAULT; + else if ( bits[0] != ACPI_PDC_REVISION_ID || !bits[1] ) + ret = -EINVAL; + else if ( copy_from_guest_offset(bits + 2, pdc, 2, 1) ) + ret = -EFAULT; + else + { + u32 mask = 0; + + if ( xen_processor_pmbits & XEN_PROCESSOR_PM_CX ) + mask |= ACPI_PDC_C_MASK | ACPI_PDC_SMP_C1PT; + if ( xen_processor_pmbits & XEN_PROCESSOR_PM_PX ) + mask |= ACPI_PDC_P_MASK | ACPI_PDC_SMP_C1PT; + if ( xen_processor_pmbits & XEN_PROCESSOR_PM_TX ) + mask |= ACPI_PDC_T_MASK | ACPI_PDC_SMP_C1PT; + bits[2] &= (ACPI_PDC_C_MASK | ACPI_PDC_P_MASK | ACPI_PDC_T_MASK | + ACPI_PDC_SMP_C1PT) & ~mask; + ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask); + } + if ( !ret ) + ret = copy_to_guest_offset(pdc, 2, bits + 2, 1); + + return ret; +} diff -r 25dfe53bb189 -r 2029263c501c xen/include/acpi/cpufreq/processor_perf.h --- a/xen/include/acpi/cpufreq/processor_perf.h Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/include/acpi/cpufreq/processor_perf.h Mon Aug 22 10:12:36 2011 +0100 @@ -3,10 +3,10 @@ #include #include +#include #define XEN_PX_INIT 0x80000000 -int get_cpu_id(u32); int powernow_cpufreq_init(void); unsigned int powernow_register_driver(void); unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); diff -r 25dfe53bb189 -r 2029263c501c xen/include/acpi/pdc_intel.h --- a/xen/include/acpi/pdc_intel.h Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/include/acpi/pdc_intel.h Mon Aug 22 10:12:36 2011 +0100 @@ -4,6 +4,8 @@ #ifndef __PDC_INTEL_H__ #define __PDC_INTEL_H__ +#define ACPI_PDC_REVISION_ID 1 + #define ACPI_PDC_P_FFH (0x0001) #define ACPI_PDC_C_C1_HALT (0x0002) #define ACPI_PDC_T_FFH (0x0004) @@ -14,6 +16,7 @@ #define ACPI_PDC_SMP_T_SWCOORD (0x0080) #define ACPI_PDC_C_C1_FFH (0x0100) #define ACPI_PDC_C_C2C3_FFH (0x0200) +#define ACPI_PDC_SMP_P_HWCOORD (0x0800) #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ ACPI_PDC_C_C1_HALT | \ @@ -22,6 +25,7 @@ #define ACPI_PDC_EST_CAPABILITY_SWSMP (ACPI_PDC_SMP_C1PT | \ ACPI_PDC_C_C1_HALT | \ ACPI_PDC_SMP_P_SWCOORD | \ + ACPI_PDC_SMP_P_HWCOORD | \ ACPI_PDC_P_FFH) #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ @@ -30,4 +34,17 @@ ACPI_PDC_C_C1_FFH | \ ACPI_PDC_C_C2C3_FFH) +#define ACPI_PDC_C_MASK (ACPI_PDC_C_C1_HALT | \ + ACPI_PDC_C_C1_FFH | \ + ACPI_PDC_SMP_C2C3 | \ + ACPI_PDC_SMP_C_SWCOORD | \ + ACPI_PDC_C_C2C3_FFH) + +#define ACPI_PDC_P_MASK (ACPI_PDC_P_FFH | \ + ACPI_PDC_SMP_P_SWCOORD | \ + ACPI_PDC_SMP_P_HWCOORD) + +#define ACPI_PDC_T_MASK (ACPI_PDC_T_FFH | \ + ACPI_PDC_SMP_T_SWCOORD) + #endif /* __PDC_INTEL_H__ */ diff -r 25dfe53bb189 -r 2029263c501c xen/include/asm-x86/cpufeature.h --- a/xen/include/asm-x86/cpufeature.h Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/include/asm-x86/cpufeature.h Mon Aug 22 10:12:36 2011 +0100 @@ -152,6 +152,10 @@ #define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) #define cpufeat_mask(idx) (1u << ((idx) & 31)) +#define CPUID_MWAIT_LEAF 5 +#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1 +#define CPUID5_ECX_INTERRUPT_BREAK 0x2 + #ifdef __i386__ #define cpu_has_vme boot_cpu_has(X86_FEATURE_VME) #define cpu_has_de boot_cpu_has(X86_FEATURE_DE) diff -r 25dfe53bb189 -r 2029263c501c xen/include/public/platform.h --- a/xen/include/public/platform.h Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/include/public/platform.h Mon Aug 22 10:12:36 2011 +0100 @@ -304,6 +304,7 @@ #define XEN_PM_CX 0 #define XEN_PM_PX 1 #define XEN_PM_TX 2 +#define XEN_PM_PDC 3 /* Px sub info type */ #define XEN_PX_PCT 1 @@ -401,6 +402,7 @@ union { struct xen_processor_power power;/* Cx: _CST/_CSD */ struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */ + XEN_GUEST_HANDLE(uint32) pdc; /* _PDC */ } u; }; typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t; diff -r 25dfe53bb189 -r 2029263c501c xen/include/xen/acpi.h --- a/xen/include/xen/acpi.h Mon Aug 22 10:11:10 2011 +0100 +++ b/xen/include/xen/acpi.h Mon Aug 22 10:12:36 2011 +0100 @@ -322,6 +322,8 @@ #endif /*!CONFIG_ACPI_BOOT*/ +int get_cpu_id(u32 acpi_id); + unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); @@ -358,6 +360,9 @@ static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; } #endif +int acpi_set_pdc_bits(u32 acpi_id, XEN_GUEST_HANDLE(uint32)); +int arch_acpi_set_pdc_bits(u32 acpi_id, u32 *, u32 mask); + #ifdef CONFIG_ACPI_NUMA int acpi_get_pxm(acpi_handle handle); #else _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 22 10:22:21 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 22 Aug 2011 10:22:21 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QvYCb-0008HU-Eq; Mon, 22 Aug 2011 10:22:21 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1QvYCY-0008Gc-Ao for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 10:22:18 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-21.messagelabs.com!1314033728!56808857!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25916 invoked from network); 22 Aug 2011 17:22:08 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 22 Aug 2011 17:22:08 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QvYCV-0000R7-92 for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 18:22:15 +0100 Message-Id: Date: Mon, 22 Aug 2011 18:22:14 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] x86: use 'dom0_mem' to limit the number of pages for dom0 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User David Vrabel # Date 1314004575 -3600 # Node ID 473d6cd9dddf1e573dfc129b7bc055e3e71a489f # Parent 9dd0eb4f20d4500cecfe17dc50368d20906223a4 x86: use 'dom0_mem' to limit the number of pages for dom0 Use the 'dom0_mem' command line option to set the maximum number of pages for dom0. dom0 can use then use the XENMEM_maximum_reservation memory op to automatically find this limit and reduce the size of any page tables etc. Signed-off-by: David Vrabel xen-unstable changeset: 23779:c56dd5eb0fa2 xen-unstable date: Mon Aug 22 10:05:27 2011 +0100 --- diff -r 9dd0eb4f20d4 -r 473d6cd9dddf xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Mon Aug 22 10:14:14 2011 +0100 +++ b/xen/arch/x86/domain_build.c Mon Aug 22 10:16:15 2011 +0100 @@ -253,6 +253,8 @@ } #endif + d->max_pages = min(max_pages, avail); + return nr_pages; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 22 10:22:31 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 22 Aug 2011 10:22:31 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QvYCl-0008Kd-S7; Mon, 22 Aug 2011 10:22:31 -0700 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xensource.com with esmtp (Exim 4.43) id 1QvYCW-0008Gd-Kp for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 10:22:19 -0700 Received: from [85.158.139.83:60644] by server-7.bemta-5.messagelabs.com id AE/81-14026-740925E4; Mon, 22 Aug 2011 17:22:15 +0000 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-7.tower-182.messagelabs.com!1314033735!10455331!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 22911 invoked from network); 22 Aug 2011 17:22:15 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 22 Aug 2011 17:22:15 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QvYCU-0000Pc-M1 for xen-changelog@lists.xensource.com; Mon, 22 Aug 2011 18:22:14 +0100 Message-Id: Date: Mon, 22 Aug 2011 18:22:13 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] cpuidle: initialize default Cstate information X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Kevin Tian # Date 1314004454 -3600 # Node ID 9dd0eb4f20d4500cecfe17dc50368d20906223a4 # Parent a79c1d5b946edce0f9f5b4bda061e2ad98adc4da cpuidle: initialize default Cstate information C0/C1 should be always available when cpuidle is enabled in Xen. When there's case that Dom0 doesn't register ACPI Cstate information, e.g. due to BIOS issue or acpi processor module is not installed, this patch provides basic C0/C1 information available to xenpm tool. Signed-off-by: Kevin Tian xen-unstable changeset: 23662:2faba14bac13 xen-unstable date: Fri Jul 08 08:32:37 2011 +0100 --- diff -r a79c1d5b946e -r 9dd0eb4f20d4 xen/arch/x86/acpi/cpu_idle.c --- a/xen/arch/x86/acpi/cpu_idle.c Fri Aug 19 10:00:25 2011 +0100 +++ b/xen/arch/x86/acpi/cpu_idle.c Mon Aug 22 10:14:14 2011 +0100 @@ -52,6 +52,8 @@ #include #include #include +#include +#include /*#define DEBUG_PM_CX*/ @@ -598,23 +600,51 @@ halt(); } -static int init_cx_pminfo(struct acpi_processor_power *acpi_power) +static int cpuidle_init_cpu(int cpu) { - int i; + struct acpi_processor_power *acpi_power; - memset(acpi_power, 0, sizeof(*acpi_power)); + acpi_power = processor_powers[cpu]; + if ( !acpi_power ) + { + int i; + acpi_power = xmalloc(struct acpi_processor_power); + if ( !acpi_power ) + return -ENOMEM; + memset(acpi_power, 0, sizeof(*acpi_power)); - for ( i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++ ) - acpi_power->states[i].idx = i; + for ( i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++ ) + acpi_power->states[i].idx = i; + + acpi_power->states[ACPI_STATE_C1].type = ACPI_STATE_C1; + acpi_power->states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_EM_HALT; + + acpi_power->states[ACPI_STATE_C0].valid = 1; + acpi_power->states[ACPI_STATE_C1].valid = 1; + + acpi_power->count = 2; + acpi_power->safe_state = &acpi_power->states[ACPI_STATE_C1]; + acpi_power->cpu = cpu; + processor_powers[cpu] = acpi_power; + } - acpi_power->states[ACPI_STATE_C1].type = ACPI_STATE_C1; - acpi_power->states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_EM_HALT; - - acpi_power->states[ACPI_STATE_C0].valid = 1; - acpi_power->states[ACPI_STATE_C1].valid = 1; - - acpi_power->count = 2; - acpi_power->safe_state = &acpi_power->states[ACPI_STATE_C1]; + if ( cpu == 0 ) + { + if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) ) + { + get_tick = get_stime_tick; + ticks_elapsed = stime_ticks_elapsed; + tick_to_ns = stime_tick_to_ns; + ns_to_tick = ns_to_stime_tick; + } + else + { + get_tick = get_acpi_pm_tick; + ticks_elapsed = acpi_pm_ticks_elapsed; + tick_to_ns = acpi_pm_tick_to_ns; + ns_to_tick = ns_to_acpi_pm_tick; + } + } return 0; } @@ -943,7 +973,7 @@ XEN_GUEST_HANDLE(xen_processor_cx_t) states; xen_processor_cx_t xen_cx; struct acpi_processor_power *acpi_power; - int cpu_id, i; + int cpu_id, i, ret; if ( unlikely(!guest_handle_okay(power->states, power->count)) ) return -EFAULT; @@ -955,46 +985,19 @@ if ( cpu_id == -1 ) { printk(XENLOG_ERR "no cpu_id for acpi_id %d\n", cpu); - return -EFAULT; + return -EINVAL; } - if ( cpu_id == 0 ) - { - if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) ) - { - get_tick = get_stime_tick; - ticks_elapsed = stime_ticks_elapsed; - tick_to_ns = stime_tick_to_ns; - ns_to_tick = ns_to_stime_tick; - } - else - { - get_tick = get_acpi_pm_tick; - ticks_elapsed = acpi_pm_ticks_elapsed; - tick_to_ns = acpi_pm_tick_to_ns; - ns_to_tick = ns_to_acpi_pm_tick; - } - } - + ret = cpuidle_init_cpu(cpu_id); + if ( ret < 0 ) + return ret; + acpi_power = processor_powers[cpu_id]; - if ( !acpi_power ) - { - acpi_power = xmalloc(struct acpi_processor_power); - if ( !acpi_power ) - return -ENOMEM; - memset(acpi_power, 0, sizeof(*acpi_power)); - processor_powers[cpu_id] = acpi_power; - } - - init_cx_pminfo(acpi_power); - - acpi_power->cpu = cpu_id; acpi_power->flags.bm_check = power->flags.bm_check; acpi_power->flags.bm_control = power->flags.bm_control; acpi_power->flags.has_cst = power->flags.has_cst; states = power->states; - for ( i = 0; i < power->count; i++ ) { if ( unlikely(copy_from_guest_offset(&xen_cx, states, i, 1)) ) @@ -1009,19 +1012,17 @@ /* FIXME: C-state dependency is not supported by far */ - /*print_acpi_power(cpu_id, acpi_power);*/ - - if ( cpu_id == 0 && pm_idle_save == NULL ) - { - pm_idle_save = pm_idle; - pm_idle = acpi_processor_idle; - } - if ( cpu_id == 0 ) { + if ( pm_idle_save == NULL ) + { + pm_idle_save = pm_idle; + pm_idle = acpi_processor_idle; + } + dead_idle = acpi_dead_idle; } - + return 0; } @@ -1032,7 +1033,7 @@ int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat) { - const struct acpi_processor_power *power = processor_powers[cpuid]; + struct acpi_processor_power *power = processor_powers[cpuid]; uint64_t usage, res, idle_usage = 0, idle_res = 0; int i; struct hw_residencies hw_res = {0}; @@ -1049,6 +1050,30 @@ stat->nr = power->count; stat->idle_time = get_cpu_idle_time(cpuid); + /* mimic the stat when detail info hasn't been registered by dom0 */ + if ( pm_idle_save == NULL ) + { + /* C1 */ + usage = 1; + res = stat->idle_time; + if ( copy_to_guest_offset(stat->triggers, 1, &usage, 1) || + copy_to_guest_offset(stat->residencies, 1, &res, 1) ) + return -EFAULT; + + /* C0 */ + res = NOW() - res; + if ( copy_to_guest_offset(stat->triggers, 0, &usage, 1) || + copy_to_guest_offset(stat->residencies, 0, &res, 1) ) + return -EFAULT; + + stat->pc3 = 0; + stat->pc6 = 0; + stat->pc7 = 0; + stat->cc3 = 0; + stat->cc6 = 0; + return 0; + } + for ( i = power->count - 1; i >= 0; i-- ) { if ( i != 0 ) @@ -1103,3 +1128,36 @@ { return xen_cpuidle && max_cstate > (local_apic_timer_c2_ok ? 2 : 1); } + +static int cpu_callback( + struct notifier_block *nfb, unsigned long action, void *hcpu) +{ + unsigned int cpu = (unsigned long)hcpu; + + /* Only hook on CPU_ONLINE because a dead cpu may utilize the info to + * to enter deep C-state */ + switch ( action ) + { + case CPU_ONLINE: + (void)cpuidle_init_cpu(cpu); + break; + default: + break; + } + + return NOTIFY_DONE; +} + +static struct notifier_block cpu_nfb = { + .notifier_call = cpu_callback +}; + +static int __init cpuidle_presmp_init(void) +{ + void *cpu = (void *)(long)smp_processor_id(); + cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); + register_cpu_notifier(&cpu_nfb); + return 0; +} +presmp_initcall(cpuidle_presmp_init); + diff -r a79c1d5b946e -r 9dd0eb4f20d4 xen/arch/x86/smpboot.c --- a/xen/arch/x86/smpboot.c Fri Aug 19 10:00:25 2011 +0100 +++ b/xen/arch/x86/smpboot.c Mon Aug 22 10:14:14 2011 +0100 @@ -45,7 +45,6 @@ #include #include #include -#include #define setup_trampoline() (bootsym_phys(trampoline_realmode_entry)) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 13:22:15 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 13:22:15 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwJxn-00035E-Iq; Wed, 24 Aug 2011 13:22:15 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwJxk-00034e-PW for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 13:22:13 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-10.tower-21.messagelabs.com!1314217316!51609114!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26112 invoked from network); 24 Aug 2011 20:21:57 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 20:21:57 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwJxh-0002RO-BC for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 21:22:09 +0100 Message-Id: Date: Wed, 24 Aug 2011 21:22:08 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] x86: don't limit dom0's maximum reservation by the available memory X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User David Vrabel # Date 1314174894 -3600 # Node ID c7702b73f3823512864a39380799bf643f0312bf # Parent 473d6cd9dddf1e573dfc129b7bc055e3e71a489f x86: don't limit dom0's maximum reservation by the available memory Set dom0's initial maximum reservation using the max value supplied in the dom0_mem command line option without limiting it by the available memory. This allows dom0 to make use of any hotplugged memory without having to also adjust the maximum reservation. Signed-off-by: David Vrabel Acked-by: Jan Beulich xen-unstable changeset: 23790:1515138fbd7b xen-unstable date: Wed Aug 24 09:33:10 2011 +0100 --- diff -r 473d6cd9dddf -r c7702b73f382 xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Mon Aug 22 10:16:15 2011 +0100 +++ b/xen/arch/x86/domain_build.c Wed Aug 24 09:34:54 2011 +0100 @@ -253,7 +253,7 @@ } #endif - d->max_pages = min(max_pages, avail); + d->max_pages = min_t(unsigned long, max_pages, UINT_MAX); return nr_pages; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 14:44:16 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 14:44:16 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLFA-00016R-O2; Wed, 24 Aug 2011 14:44:16 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLF7-00014T-C1 for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 14:44:13 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-21.messagelabs.com!1314222242!57079198!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20975 invoked from network); 24 Aug 2011 21:44:02 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 21:44:02 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwLF4-0003Ru-6g for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 22:44:10 +0100 Message-Id: Date: Wed, 24 Aug 2011 22:44:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Adjust non-debug ASSERT() definition to avoid unused-variable warnings. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314026119 -3600 # Node ID d1cd78a73a79e0e648937322cdb8d92a7f86327a # Parent ab664a21ae45a8c86b5ffdb73f171c72c2ae5615 Adjust non-debug ASSERT() definition to avoid unused-variable warnings. Signed-off-by: Keir Fraser --- diff -r ab664a21ae45 -r d1cd78a73a79 xen/include/xen/lib.h --- a/xen/include/xen/lib.h Mon Aug 22 14:37:29 2011 +0100 +++ b/xen/include/xen/lib.h Mon Aug 22 16:15:19 2011 +0100 @@ -37,7 +37,7 @@ #define ASSERT(p) \ do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0) #else -#define ASSERT(p) ((void)0) +#define ASSERT(p) do { if ( 0 && (p) ); } while (0) #endif #define ABS(_x) ({ \ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 14:44:27 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 14:44:27 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLFL-00019s-3s; Wed, 24 Aug 2011 14:44:27 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLF7-00014S-Aa for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 14:44:13 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-15.tower-216.messagelabs.com!1314222250!15495571!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 22888 invoked from network); 24 Aug 2011 21:44:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 21:44:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwLF3-0003Rf-Lp for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 22:44:09 +0100 Message-Id: Date: Wed, 24 Aug 2011 22:44:08 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] nested-p2m: suppress np2m flushes during p2m setup X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Christoph Egger # Date 1314020249 -3600 # Node ID ab664a21ae45a8c86b5ffdb73f171c72c2ae5615 # Parent 2029263c501c315fa4d94845e5cfa6a9b0b395d5 nested-p2m: suppress np2m flushes during p2m setup There is no need to send IPIs within p2m_alloc_table() via set_p2m_entry(). Signed-off-by: Christoph Egger Committed-by: Tim Deegan --- diff -r 2029263c501c -r ab664a21ae45 xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Mon Aug 22 10:12:36 2011 +0100 +++ b/xen/arch/x86/mm/p2m.c Mon Aug 22 14:37:29 2011 +0100 @@ -245,6 +245,7 @@ P2M_PRINTK("populating p2m table\n"); /* Initialise physmap tables for slot zero. Other code assumes this. */ + p2m->defer_nested_flush = 1; if ( !set_p2m_entry(p2m, 0, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access) ) goto error; @@ -272,6 +273,7 @@ } spin_unlock(&p2m->domain->page_alloc_lock); } + p2m->defer_nested_flush = 0; P2M_PRINTK("p2m table initialised (%u pages)\n", page_count); p2m_unlock(p2m); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 14:44:36 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 14:44:36 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLFU-0001DV-DM; Wed, 24 Aug 2011 14:44:36 -0700 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLF7-000152-Lk for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 14:44:13 -0700 Received: from [85.158.139.83:13115] by server-2.bemta-5.messagelabs.com id 72/00-03301-CA0755E4; Wed, 24 Aug 2011 21:44:12 +0000 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-182.messagelabs.com!1314222252!15601054!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23127 invoked from network); 24 Aug 2011 21:44:12 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 21:44:12 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwLF6-0003Ss-5B for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 22:44:12 +0100 Message-Id: Date: Wed, 24 Aug 2011 22:44:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Passthrough: fix iommu_use_hap_pt() to use hap_enabled() X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314093267 -3600 # Node ID 1b77cf8305df0fa27acd0701f6dfbf5acbffb238 # Parent 9d2a8912597dba29e57a3e4db0a98f1f6c73168d Passthrough: fix iommu_use_hap_pt() to use hap_enabled() In line with 22924:86000076dcee, paging_mode_hap(d) shouldn't be used in HAP internals that are called during HAP setup. Signed-off-by: Tim Deegan --- diff -r 9d2a8912597d -r 1b77cf8305df xen/include/xen/iommu.h --- a/xen/include/xen/iommu.h Tue Aug 23 10:43:25 2011 +0100 +++ b/xen/include/xen/iommu.h Tue Aug 23 10:54:27 2011 +0100 @@ -35,7 +35,7 @@ extern bool_t amd_iommu_perdev_intremap; /* Does this domain have a P2M table we can use as its IOMMU pagetable? */ -#define iommu_use_hap_pt(d) (paging_mode_hap(d) && iommu_hap_pt_share) +#define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share) extern struct rangeset *mmio_ro_ranges; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 14:44:44 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 14:44:44 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLFb-0001GX-Uw; Wed, 24 Aug 2011 14:44:44 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLF7-00014X-Mk for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 14:44:14 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-21.messagelabs.com!1314222219!57721173!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22833 invoked from network); 24 Aug 2011 21:43:39 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 21:43:39 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwLF4-0003S9-Mu for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 22:44:10 +0100 Message-Id: Date: Wed, 24 Aug 2011 22:44:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: Fix up irq vector map logic X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User George Dunlap # Date 1314026133 -3600 # Node ID 3a05da2dc7c0a5fc0fcfc40c535d1fcb71203625 # Parent d1cd78a73a79e0e648937322cdb8d92a7f86327a x86: Fix up irq vector map logic We need to make sure that cfg->used_vector is only cleared once; otherwise there may be a race condition that allows the same vector to be assigned twice, defeating the whole purpose of the map. This makes two changes: * __clear_irq_vector() only clears the vector if the irq is not being moved * smp_iqr_move_cleanup_interrupt() only clears used_vector if this is the last place it's being used (move_cleanup_count==0 after decrement). Also make use of asserts more consistent, to catch this kind of logic bug in the future. Signed-off-by: George Dunlap --- diff -r d1cd78a73a79 -r 3a05da2dc7c0 xen/arch/x86/io_apic.c --- a/xen/arch/x86/io_apic.c Mon Aug 22 16:15:19 2011 +0100 +++ b/xen/arch/x86/io_apic.c Mon Aug 22 16:15:33 2011 +0100 @@ -485,12 +485,14 @@ irq, vector, smp_processor_id()); __get_cpu_var(vector_irq)[vector] = -1; - if ( cfg->used_vectors ) + cfg->move_cleanup_count--; + + if ( cfg->move_cleanup_count == 0 + && cfg->used_vectors ) { ASSERT(test_bit(vector, cfg->used_vectors)); clear_bit(vector, cfg->used_vectors); } - cfg->move_cleanup_count--; unlock: spin_unlock(&desc->lock); } diff -r d1cd78a73a79 -r 3a05da2dc7c0 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Mon Aug 22 16:15:19 2011 +0100 +++ b/xen/arch/x86/irq.c Mon Aug 22 16:15:33 2011 +0100 @@ -113,7 +113,10 @@ cfg->vector = vector; cfg->cpu_mask = online_mask; if ( cfg->used_vectors ) + { + ASSERT(!test_bit(vector, cfg->used_vectors)); set_bit(vector, cfg->used_vectors); + } irq_status[irq] = IRQ_USED; if (IO_APIC_IRQ(irq)) irq_vector[irq] = vector; @@ -207,15 +210,13 @@ for_each_cpu_mask(cpu, tmp_mask) per_cpu(vector_irq, cpu)[vector] = -1; - if ( cfg->used_vectors ) - clear_bit(vector, cfg->used_vectors); - cfg->vector = IRQ_VECTOR_UNASSIGNED; cpus_clear(cfg->cpu_mask); init_one_irq_status(irq); if (likely(!cfg->move_in_progress)) return; + cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map); for_each_cpu_mask(cpu, tmp_mask) { for (vector = FIRST_DYNAMIC_VECTOR; vector <= LAST_DYNAMIC_VECTOR; @@ -229,6 +230,12 @@ } } + if ( cfg->used_vectors ) + { + ASSERT(test_bit(vector, cfg->used_vectors)); + clear_bit(vector, cfg->used_vectors); + } + cfg->move_in_progress = 0; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 14:44:52 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 14:44:52 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLFj-0001Jt-G3; Wed, 24 Aug 2011 14:44:51 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLF8-00014w-EZ for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 14:44:14 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-7.tower-174.messagelabs.com!1314222251!29012927!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16461 invoked from network); 24 Aug 2011 21:44:11 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 21:44:11 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwLF5-0003SO-67 for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 22:44:11 +0100 Message-Id: Date: Wed, 24 Aug 2011 22:44:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] VT-d: Explicitly test EPT capabilities during IOMMU init X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314092600 -3600 # Node ID 41f00cf6b82205cab03a583356c6a64855539726 # Parent 3a05da2dc7c0a5fc0fcfc40c535d1fcb71203625 VT-d: Explicitly test EPT capabilities during IOMMU init because the cached version isn't set up until the EPT init happens. Signed-off-by: Tim Deegan --- diff -r 3a05da2dc7c0 -r 41f00cf6b822 xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Mon Aug 22 16:15:33 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Tue Aug 23 10:43:20 2011 +0100 @@ -1739,15 +1739,15 @@ static int vtd_ept_page_compatible(struct iommu *iommu) { - u64 cap = iommu->cap; + u64 ept_cap, vtd_cap = iommu->cap; - if ( ept_has_2mb(cpu_has_vmx_ept_2mb) != cap_sps_2mb(cap) ) + /* EPT is not initialised yet, so we must check the capability in + * the MSR explicitly rather than use cpu_has_vmx_ept_*() */ + if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 ) return 0; - if ( ept_has_1gb(cpu_has_vmx_ept_1gb) != cap_sps_1gb(cap) ) - return 0; - - return 1; + return ( ept_has_2mb(ept_cap) == cap_sps_2mb(vtd_cap) + && ept_has_1gb(ept_cap) == cap_sps_1gb(vtd_cap) ); } /* _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 14:44:59 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 14:44:59 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLFq-0001My-Jr; Wed, 24 Aug 2011 14:44:59 -0700 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLF8-000159-Up for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 14:44:15 -0700 Received: from [85.158.139.83:33338] by server-8.bemta-5.messagelabs.com id D0/91-10259-CA0755E4; Wed, 24 Aug 2011 21:44:12 +0000 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-182.messagelabs.com!1314222252!15601055!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23134 invoked from network); 24 Aug 2011 21:44:12 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 21:44:12 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwLF6-0003T7-Kc for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 22:44:12 +0100 Message-Id: Date: Wed, 24 Aug 2011 22:44:12 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: don't limit dom0's maximum reservation by the available memory X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User David Vrabel # Date 1314174790 -3600 # Node ID 1515138fbd7b31a508361e31040a8b163325e50b # Parent 1b77cf8305df0fa27acd0701f6dfbf5acbffb238 x86: don't limit dom0's maximum reservation by the available memory Set dom0's initial maximum reservation using the max value supplied in the dom0_mem command line option without limiting it by the available memory. This allows dom0 to make use of any hotplugged memory without having to also adjust the maximum reservation. Signed-off-by: David Vrabel Acked-by: Jan Beulich --- diff -r 1b77cf8305df -r 1515138fbd7b xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Tue Aug 23 10:54:27 2011 +0100 +++ b/xen/arch/x86/domain_build.c Wed Aug 24 09:33:10 2011 +0100 @@ -254,7 +254,7 @@ } #endif - d->max_pages = min(max_pages, avail); + d->max_pages = min_t(unsigned long, max_pages, UINT_MAX); return nr_pages; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 24 14:45:08 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 24 Aug 2011 14:45:08 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLFz-0001Qr-Vm; Wed, 24 Aug 2011 14:45:08 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwLF8-00014z-N6 for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 14:44:15 -0700 X-VirusChecked: Checked X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-13.tower-216.messagelabs.com!1314222251!15873668!1 X-StarScan-Version: 6.2.17; banners=-,-,- X-Originating-IP: [93.93.131.152] Received: (qmail 8494 invoked from network); 24 Aug 2011 21:44:11 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 24 Aug 2011 21:44:11 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwLF5-0003Sd-M9 for xen-changelog@lists.xensource.com; Wed, 24 Aug 2011 22:44:11 +0100 Message-Id: Date: Wed, 24 Aug 2011 22:44:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] IOMMU: only try to share IOMMU and HAP tables for domains with P2M. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314092605 -3600 # Node ID 9d2a8912597dba29e57a3e4db0a98f1f6c73168d # Parent 41f00cf6b82205cab03a583356c6a64855539726 IOMMU: only try to share IOMMU and HAP tables for domains with P2M. This makes the check more precise, and brings VTd in line with AMD code. Signed-off-by: Tim Deegan --- diff -r 41f00cf6b822 -r 9d2a8912597d xen/drivers/passthrough/amd/iommu_map.c --- a/xen/drivers/passthrough/amd/iommu_map.c Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/drivers/passthrough/amd/iommu_map.c Tue Aug 23 10:43:25 2011 +0100 @@ -758,7 +758,7 @@ BUG_ON( !hd->root_table ); - if ( iommu_hap_pt_share && is_hvm_domain(d) ) + if ( iommu_use_hap_pt(d) ) return 0; memset(pt_mfn, 0, sizeof(pt_mfn)); @@ -835,7 +835,7 @@ BUG_ON( !hd->root_table ); - if ( iommu_hap_pt_share && is_hvm_domain(d) ) + if ( iommu_use_hap_pt(d) ) return 0; memset(pt_mfn, 0, sizeof(pt_mfn)); @@ -935,7 +935,7 @@ ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled ); - if ( !iommu_hap_pt_share ) + if ( !iommu_use_hap_pt(d) ) return; pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))); diff -r 41f00cf6b822 -r 9d2a8912597d xen/drivers/passthrough/amd/pci_amd_iommu.c --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c Tue Aug 23 10:43:25 2011 +0100 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -388,7 +389,7 @@ { struct hvm_iommu *hd = domain_hvm_iommu(d); - if ( iommu_hap_pt_share ) + if ( iommu_use_hap_pt(d) ) return; spin_lock(&hd->mapping_lock); diff -r 41f00cf6b822 -r 9d2a8912597d xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Tue Aug 23 10:43:25 2011 +0100 @@ -180,7 +180,7 @@ if ( has_arch_pdevs(d) && !need_iommu(d) ) { d->need_iommu = 1; - if ( !iommu_hap_pt_share ) + if ( !iommu_use_hap_pt(d) ) rc = iommu_populate_page_table(d); goto done; } diff -r 41f00cf6b822 -r 9d2a8912597d xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Tue Aug 23 10:43:25 2011 +0100 @@ -1613,7 +1613,7 @@ if ( list_empty(&acpi_drhd_units) ) return; - if ( iommu_hap_pt_share ) + if ( iommu_use_hap_pt(d) ) return; spin_lock(&hd->mapping_lock); @@ -1635,7 +1635,7 @@ int iommu_domid; /* Do nothing if VT-d shares EPT page table */ - if ( iommu_hap_pt_share ) + if ( iommu_use_hap_pt(d) ) return 0; /* do nothing if dom0 and iommu supports pass thru */ @@ -1760,7 +1760,7 @@ ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled ); - if ( !iommu_hap_pt_share ) + if ( !iommu_use_hap_pt(d) ) return; pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))); diff -r 41f00cf6b822 -r 9d2a8912597d xen/include/xen/iommu.h --- a/xen/include/xen/iommu.h Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/include/xen/iommu.h Tue Aug 23 10:43:25 2011 +0100 @@ -34,6 +34,9 @@ extern bool_t iommu_debug; extern bool_t amd_iommu_perdev_intremap; +/* Does this domain have a P2M table we can use as its IOMMU pagetable? */ +#define iommu_use_hap_pt(d) (paging_mode_hap(d) && iommu_hap_pt_share) + extern struct rangeset *mmio_ro_ranges; #define domain_hvm_iommu(d) (&d->arch.hvm_domain.hvm_iommu) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 07:44:16 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 07:44:16 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwbAF-0005NR-RP; Thu, 25 Aug 2011 07:44:15 -0700 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwbAC-0005Mi-NV for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 07:44:12 -0700 Received: from [85.158.139.83:24546] by server-3.bemta-5.messagelabs.com id 71/EB-10740-BBF565E4; Thu, 25 Aug 2011 14:44:11 +0000 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-13.tower-182.messagelabs.com!1314283450!15715876!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31837 invoked from network); 25 Aug 2011 14:44:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 25 Aug 2011 14:44:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwbA9-0005zj-SD for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 15:44:09 +0100 Message-Id: Date: Thu, 25 Aug 2011 15:44:09 +0100 From: Xen patchbot-4.0-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.0-testing] Added tag 4.0.3-rc1 for changeset 47f9c9648fe7 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314268793 -3600 # Node ID 27d2378f47371c57b879fa540e8badbbd1a164a7 # Parent 47f9c9648fe7b531e41575a2bf0b0234037985b4 Added tag 4.0.3-rc1 for changeset 47f9c9648fe7 --- diff -r 47f9c9648fe7 -r 27d2378f4737 .hgtags --- a/.hgtags Thu Aug 25 11:39:49 2011 +0100 +++ b/.hgtags Thu Aug 25 11:39:53 2011 +0100 @@ -60,3 +60,4 @@ d4cefc444b74eb161a5f7f96ada35347e36004d4 4.0.2-rc5 4c39fa80900da554a16ac7a6c053288bc53a99b0 4.0.2-rc6 e7ec1f3ebed8ddc28ec5e80ac520c8b9abdae132 RELEASE-4.0.2 +47f9c9648fe7b531e41575a2bf0b0234037985b4 4.0.3-rc1 _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 07:44:24 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 07:44:24 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwbAM-0005QX-Rj; Thu, 25 Aug 2011 07:44:22 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwbAC-0005Mg-Jh for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 07:44:13 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-11.tower-27.messagelabs.com!1314283443!34779747!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18261 invoked from network); 25 Aug 2011 14:44:03 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 25 Aug 2011 14:44:03 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwbA9-0005zT-Cr for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 15:44:09 +0100 Message-Id: Date: Thu, 25 Aug 2011 15:44:08 +0100 From: Xen patchbot-4.0-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.0-testing] Update Xen version to 4.0.3-rc1 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314268789 -3600 # Node ID 47f9c9648fe7b531e41575a2bf0b0234037985b4 # Parent cb453558fd2bfd52b715e9ae650cc9e2a8145d17 Update Xen version to 4.0.3-rc1 --- diff -r cb453558fd2b -r 47f9c9648fe7 Config.mk --- a/Config.mk Tue Aug 16 15:27:06 2011 +0100 +++ b/Config.mk Thu Aug 25 11:39:49 2011 +0100 @@ -178,7 +178,7 @@ # CONFIG_QEMU ?= ../qemu-xen.git CONFIG_QEMU ?= $(QEMU_REMOTE) -QEMU_TAG := xen-4.0.2 +QEMU_TAG := xen-4.0.3-rc1 #QEMU_TAG ?= 6d5b7ee3acfe8cc10681d2583a38398f7470ec2a # Wed Jan 5 23:42:03 2011 +0000 # Change tap device mac address to prevent change of bridge's mac diff -r cb453558fd2b -r 47f9c9648fe7 xen/Makefile --- a/xen/Makefile Tue Aug 16 15:27:06 2011 +0100 +++ b/xen/Makefile Thu Aug 25 11:39:49 2011 +0100 @@ -2,7 +2,7 @@ # All other places this is stored (eg. compile.h) should be autogenerated. export XEN_VERSION = 4 export XEN_SUBVERSION = 0 -export XEN_EXTRAVERSION ?= .3-rc1-pre$(XEN_VENDORVERSION) +export XEN_EXTRAVERSION ?= .3-rc1$(XEN_VENDORVERSION) export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) -include xen-version _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 07:44:40 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 07:44:40 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwbAd-0005UB-RF; Thu, 25 Aug 2011 07:44:39 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwbAD-0005Mh-Ep for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 07:44:13 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1314283437!45351127!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 32558 invoked from network); 25 Aug 2011 14:43:57 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 25 Aug 2011 14:43:57 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwbAA-0005zy-CI for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 15:44:10 +0100 Message-Id: Date: Thu, 25 Aug 2011 15:44:09 +0100 From: Xen patchbot-4.0-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.0-testing] Added signature for changeset 47f9c9648fe7 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314268801 -3600 # Node ID 3ee2f39a7f6812ce80ba96fe69746e049149d8fd # Parent 27d2378f47371c57b879fa540e8badbbd1a164a7 Added signature for changeset 47f9c9648fe7 --- diff -r 27d2378f4737 -r 3ee2f39a7f68 .hgsigs --- a/.hgsigs Thu Aug 25 11:39:53 2011 +0100 +++ b/.hgsigs Thu Aug 25 11:40:01 2011 +0100 @@ -13,3 +13,4 @@ d4cefc444b74eb161a5f7f96ada35347e36004d4 0 iQEcBAABAgAGBQJN21yLAAoJEIP+FMlX6CvZ0LAH/2KDP0LGyfzfiq8AhImFuaL99o6WZP/QrLWeKZ7mLlNfHNk9MjwpM4EEuPzjUoXDByRSY+p9HvzJzOzGAamnPxQm8+uobfBLEGxWIRMWunraP1jHJyOQEHKRYTzUOdoyBVbRkSdDmB0b7QNOCzmyIBkgloR2Ifk0++TfQvZlGnK4CB+2/re9prHn+J2k1qF8rJEqSWtXfnj1gQLSCowdDYJYsMAk1eOfsggKdzk1ST+ZkaE+3XU7dbSnYTpTqNe213D9FIzL66SfWjrthZkQCHy2GgeC+AWQux8lWyefVvyFeRyIXkCvuBpi3zq/i7Y4lOuoYW3uMuSOPikqrhozCtQ= 4c39fa80900da554a16ac7a6c053288bc53a99b0 0 iQEcBAABAgAGBQJN6J6dAAoJEIP+FMlX6CvZl5gIAKrbajO5/HY1rfF2l74WUoS6SxgsWkK+NYyE/rR2QnBkoTBpk1J2QFuWRVAs3LgU3GAICRWwWAoKQoXfj4QJJvzTXgmwNkKXcYJ+YGn7skMqoQC05srNcSkWABsv3/dFWFrj4pPvYcxgHlQKE72zkr6mDkVH2MAXTvNBn8tmf+tsczt60p5X7p5khXDj1+TsXkcAAueeI2sbgzeZ83gumnFYcEk/8LyzJoK8JNhb3KSfY8YG8R9ET8q6PkmekA8W8ZWtue03pnCc8fchNks83TvQaxvSFWdbd9FWuOh1IkGLowYLYp+lE/sP93lyIuPqlnhtbbbmFgjaYLeJ0CIUFno= e7ec1f3ebed8ddc28ec5e80ac520c8b9abdae132 0 iQEcBAABAgAGBQJN91w/AAoJEIP+FMlX6CvZygEH/R2nEvUKTT1c9TAWZsw8H3twG8o3Ka7w6M9QP3kGLQllIxkpPh5mWZoQaBVWx5JO5KlxRO55PlGKLukSks21M6gi8qCMwUaO/EZjpP2ciYIRxoovyfxp0rNID31mxWJBela4aVNy9LZ+klFKyV16wycBLQTNxfp29ZGtE2/ex7XMv4LWihAOqUqRXo35SKZuolbCYY0qmBXcvjD8iwgkucFLFPVDOq2YmW47flQREF2IOKzeHBwfDoB4nNVJW8MA5snJ7Wg+IJlvnRFF4Ks/Y784Nhkbw0mfYVNij0eovbI9Tfs1FXcz/YlZXFdsadV9N+c1ABJsBBX3ZNbvEKl4bJ8= +47f9c9648fe7b531e41575a2bf0b0234037985b4 0 iQEcBAABAgAGBQJOViZ/AAoJEIP+FMlX6CvZovAH/2C6X/PU9h9Q8Way8NTGmZsJroS0OlPpiYoBQ/BAgha0NxO6pKiuCcuGwApcvMnDTly3UyJzrh5uf5E2Qfl5N3Zwg0fRNvpzArN8JjTZQI3yr0iDc1FioVRpllPQCKVrFkB5UUuAkXRlOJLkPc78PNaWdYvEl9lPQdyXwg1GwGsSjomH4HI4UmB1uWsx0TgNaywN1l7FZ77Ny1u7VVOczSSBFlhI1shXqCXgbMRW2pxMCNkiV6kozYuHKFzwK/ZAFSrw1d9bgVjTsSrjkAuaMTnSIFoVSpOsv0zJZnIlhKe0ChpbU90OcM2Pol3CoJIdvHZOL2Gi2T04Js+iKW25nV8= _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 10:44:20 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 10:44:20 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwdyW-0000eS-3C; Thu, 25 Aug 2011 10:44:20 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwdyQ-0000da-1l for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 10:44:14 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-216.messagelabs.com!1314294251!15970123!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22938 invoked from network); 25 Aug 2011 17:44:11 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 25 Aug 2011 17:44:11 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwdyM-00026K-M9 for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 18:44:10 +0100 Message-Id: Date: Thu, 25 Aug 2011 18:44:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] passthrough: Turn on IOMMU/HAP pagetable sharing by default. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314270194 -3600 # Node ID 227130622561e20136a1ef56201fe65ead5a76e8 # Parent 1515138fbd7b31a508361e31040a8b163325e50b passthrough: Turn on IOMMU/HAP pagetable sharing by default. Signed-off-by: Tim Deegan --- diff -r 1515138fbd7b -r 227130622561 xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Wed Aug 24 09:33:10 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Thu Aug 25 12:03:14 2011 +0100 @@ -47,7 +47,7 @@ bool_t __read_mostly iommu_snoop = 1; bool_t __read_mostly iommu_qinval = 1; bool_t __read_mostly iommu_intremap = 1; -bool_t __read_mostly iommu_hap_pt_share; +bool_t __read_mostly iommu_hap_pt_share = 1; bool_t __read_mostly iommu_debug; bool_t __read_mostly iommu_amd_perdev_vector_map = 1; bool_t __read_mostly amd_iommu_perdev_intremap; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 18:44:18 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 18:44:18 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlT0-00069e-MT; Thu, 25 Aug 2011 18:44:18 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlSx-00068l-3C for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 18:44:15 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-9.tower-216.messagelabs.com!1314323051!16020331!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14140 invoked from network); 26 Aug 2011 01:44:12 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 26 Aug 2011 01:44:12 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwlSt-0005cM-8q for xen-changelog@lists.xensource.com; Fri, 26 Aug 2011 02:44:11 +0100 Message-Id: Date: Fri, 26 Aug 2011 02:44:10 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Update Xen version to 4.1.2-rc1 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314268697 -3600 # Node ID 1f21da33dea4acb2dbfb988bcd1b7898e019316c # Parent c7702b73f3823512864a39380799bf643f0312bf Update Xen version to 4.1.2-rc1 --- diff -r c7702b73f382 -r 1f21da33dea4 Config.mk --- a/Config.mk Wed Aug 24 09:34:54 2011 +0100 +++ b/Config.mk Thu Aug 25 11:38:17 2011 +0100 @@ -196,7 +196,7 @@ # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git CONFIG_QEMU ?= $(QEMU_REMOTE) -QEMU_TAG := xen-4.1.1 +QEMU_TAG := xen-4.1.2-rc1 #QEMU_TAG ?= e073e69457b4d99b6da0b6536296e3498f7f6599 # Fri Feb 11 17:54:51 2011 +0000 # qemu-xen: fix segfault with empty cdroms diff -r c7702b73f382 -r 1f21da33dea4 xen/Makefile --- a/xen/Makefile Wed Aug 24 09:34:54 2011 +0100 +++ b/xen/Makefile Thu Aug 25 11:38:17 2011 +0100 @@ -2,7 +2,7 @@ # All other places this is stored (eg. compile.h) should be autogenerated. export XEN_VERSION = 4 export XEN_SUBVERSION = 1 -export XEN_EXTRAVERSION ?= .2-rc1-pre$(XEN_VENDORVERSION) +export XEN_EXTRAVERSION ?= .2-rc1$(XEN_VENDORVERSION) export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) -include xen-version _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 18:44:27 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 18:44:27 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlT8-0006CY-Qo; Thu, 25 Aug 2011 18:44:26 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlSx-00068m-4M for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 18:44:16 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-12.tower-27.messagelabs.com!1314323040!39844928!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31654 invoked from network); 26 Aug 2011 01:44:00 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 26 Aug 2011 01:44:00 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwlSt-0005cb-S6 for xen-changelog@lists.xensource.com; Fri, 26 Aug 2011 02:44:12 +0100 Message-Id: Date: Fri, 26 Aug 2011 02:44:11 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Added tag 4.1.2-rc1 for changeset 1f21da33dea4 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314268713 -3600 # Node ID d78a122898d593b609e9e7aa7aa5c90b67bc15c8 # Parent 1f21da33dea4acb2dbfb988bcd1b7898e019316c Added tag 4.1.2-rc1 for changeset 1f21da33dea4 --- diff -r 1f21da33dea4 -r d78a122898d5 .hgtags --- a/.hgtags Thu Aug 25 11:38:17 2011 +0100 +++ b/.hgtags Thu Aug 25 11:38:33 2011 +0100 @@ -58,3 +58,4 @@ f01f0ed5839040ee7104642bb9a6ef59f3eea52e 4.1.1-rc1 e302291362a41edc294344addda9ed0685485c06 4.1.1-rc2 ab0e3dac2c63434cd88466bdd4e89ad0075fdec4 RELEASE-4.1.1 +1f21da33dea4acb2dbfb988bcd1b7898e019316c 4.1.2-rc1 _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 18:44:37 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 18:44:37 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlTI-0006G8-1B; Thu, 25 Aug 2011 18:44:37 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlSx-00068o-JC for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 18:44:16 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-27.messagelabs.com!1314323037!40264388!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3314 invoked from network); 26 Aug 2011 01:43:57 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 26 Aug 2011 01:43:57 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwlSu-0005cq-Gp for xen-changelog@lists.xensource.com; Fri, 26 Aug 2011 02:44:12 +0100 Message-Id: Date: Fri, 26 Aug 2011 02:44:12 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Added signature for changeset 1f21da33dea4 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314268723 -3600 # Node ID 3fc53d38e619a0d9189418c56e888bcc8404a5f1 # Parent d78a122898d593b609e9e7aa7aa5c90b67bc15c8 Added signature for changeset 1f21da33dea4 --- diff -r d78a122898d5 -r 3fc53d38e619 .hgsigs --- a/.hgsigs Thu Aug 25 11:38:33 2011 +0100 +++ b/.hgsigs Thu Aug 25 11:38:43 2011 +0100 @@ -11,3 +11,4 @@ f01f0ed5839040ee7104642bb9a6ef59f3eea52e 0 iQEcBAABAgAGBQJN12K1AAoJEIP+FMlX6CvZS4wH/A0uR/rJhYcVnCuGxWH3Iq+dOyrhEsAo7FUDHlKsCmsamA3JZNcA82yL1+SM9mZqOwUitR2g6lbumBrBHeXrOVZ4HXK3dIPoriwznA0Y3cDWprzgoeaVK7I1y+2/M3NdH41keRIHG0hxB+OxTEcT3qiMmOkMRKEc1T7ok/+dHTP+/Z6/sGA+e2QyGEyVuNxcu4iv+OTFI+XUjNK/wJ3Ustk4uXXZbMUWGPs5HbnDTQqA6ddXKQXDBq+VbXoST3xbSCdwx+uJgv4nmx25NQJRX5GFmnBu6VefEZftl4el3WrYje5JnEtdKKtqMwizi0rD66dhPdZ+t9G3cjE/R+lu7EI= e302291362a41edc294344addda9ed0685485c06 0 iQEcBAABAgAGBQJN6J2ZAAoJEIP+FMlX6CvZpI4H/ArKY+yNmSShbjDWZOyqmNvdOlZb37UgONPmrt41OoF5F2ZNo23kY4Kur69O/zz4BdQCkNpR5oEaABY5UwBg648nwTCbkBlRpZY2bZmgT5KCBKlaleMdTm3KkRXr3yxwa45GkYgnmg5L7UDYCKRuHW3pom1PQpo9X2VXNcPCdc2hf2deWLf0PlHrG4BDBzPVZ306PfumEb3ZCWulff8eM2D63pd520NqWf0eJh8HyEFPaKX/3EvrkguP8WnhOV/HpLwMt983q0LBUEQiauBl+BwhpnMOKQSY0DQSchF/Tlk1Lq1wA2mfQ/Th6Zx6zSjIdQ9sb+dbnKkLfBRmx/VTuBI= ab0e3dac2c63434cd88466bdd4e89ad0075fdec4 0 iQEcBAABAgAGBQJN91v3AAoJEIP+FMlX6CvZqDkIAK34QbQOOWaOVNI0xnDW2tj3Uu7sJZ5NqSfwg7FiFnL+lb7N/jJnjL4AIn22UIJnpf5GxjmFII4Aw2xc1dHRlznxaXFPNrh6ZTL7GhRuZvQi7/kR/bgc2Io9B+Gcu9gZaRzakU5kOYt5Sv5JmVz4eJcIxblNrh6+mdzkGLjUERuC9/Ovd2fGvXYtCkOsSkyXAUyJGGui+kDAqowFMzZuxRukislO94x4P9dkVpIaX/5n67/sCo5P9DeyDrkHtAShX8DOIFhujilgRDjcB54NESRixoLntFYrqce1OWKlEG4ssE5s6wtrrPgADx92PIkqMfWrUIXx6YVd0GWjzj1Q4TU= +1f21da33dea4acb2dbfb988bcd1b7898e019316c 0 iQEcBAABAgAGBQJOViYyAAoJEIP+FMlX6CvZew0IAKJ/gjTWVmD9cBEN6XJYYW+z831Hsm4Msk9QBskJiV2cVFcaF9/SzexnC6waU1BpxMCLWNusaPl18Uc2knF0kYyXAjeWDZNcRZtcZIS/kDzPBIAGkq4wI+DA4nfFCnYNsFk9dy5aqkvVOVpvn7E6fUcOtWQC+IfuOrMo6mRjew4dPlv3xhwYgf2oQf9I1YLoJ6UVh0o1g0jHeXhYZu8Fqm/a4O0kdbvUDHuViVT0qHhGIi6dLkD0w/ih+o7S3FAMXLpLVBdt23bVBti4jwFMnMEgy2wkP4lbfM++1Io//Bn7tg4CZcNHYt6a7ENmhL+lmTbh0GyteZ9sgbfricSFkGc= _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Thu Aug 25 18:44:47 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Thu, 25 Aug 2011 18:44:47 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlTS-0006JI-9f; Thu, 25 Aug 2011 18:44:46 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1QwlSy-00068p-6Q for xen-changelog@lists.xensource.com; Thu, 25 Aug 2011 18:44:16 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-13.tower-21.messagelabs.com!1314323048!46572493!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2101 invoked from network); 26 Aug 2011 01:44:08 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 26 Aug 2011 01:44:08 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QwlSv-0005d5-00 for xen-changelog@lists.xensource.com; Fri, 26 Aug 2011 02:44:13 +0100 Message-Id: Date: Fri, 26 Aug 2011 02:44:12 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Update Xen version to 4.1.2-rc2-pre X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314282974 -3600 # Node ID 007a4037900015b8fdd3978d1bdcbe7863d959f0 # Parent 3fc53d38e619a0d9189418c56e888bcc8404a5f1 Update Xen version to 4.1.2-rc2-pre --- diff -r 3fc53d38e619 -r 007a40379000 xen/Makefile --- a/xen/Makefile Thu Aug 25 11:38:43 2011 +0100 +++ b/xen/Makefile Thu Aug 25 15:36:14 2011 +0100 @@ -2,7 +2,7 @@ # All other places this is stored (eg. compile.h) should be autogenerated. export XEN_VERSION = 4 export XEN_SUBVERSION = 1 -export XEN_EXTRAVERSION ?= .2-rc1$(XEN_VENDORVERSION) +export XEN_EXTRAVERSION ?= .2-rc2-pre$(XEN_VENDORVERSION) export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) -include xen-version _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Sat Aug 27 04:22:12 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Sat, 27 Aug 2011 04:22:12 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QxGxo-0001wo-KB; Sat, 27 Aug 2011 04:22:12 -0700 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xensource.com with esmtp (Exim 4.43) id 1QxGxj-0001wB-3n for xen-changelog@lists.xensource.com; Sat, 27 Aug 2011 04:22:07 -0700 Received: from [85.158.139.83:46642] by server-8.bemta-5.messagelabs.com id 4B/2D-10259-D53D85E4; Sat, 27 Aug 2011 11:22:05 +0000 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-182.messagelabs.com!1314444125!15920927!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18460 invoked from network); 27 Aug 2011 11:22:05 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 27 Aug 2011 11:22:05 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QxGxh-0003wt-2J for xen-changelog@lists.xensource.com; Sat, 27 Aug 2011 12:22:05 +0100 Message-Id: Date: Sat, 27 Aug 2011 12:22:04 +0100 From: Xen patchbot-linux-2.6.18-xen To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [linux-2.6.18-xen] xen/ACPI: allow passing down C1 information if no other C-states exist X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314443558 -3600 # Node ID 700f70b60d4b50e04228e54bf636ec882bf54968 # Parent 0b8a9b22b70a2a69f829182368ec4590d5e93792 xen/ACPI: allow passing down C1 information if no other C-states exist Otherwise Xen may end up not using MWAIT despite its availability. Signed-off-by: Jan Beulich Signed-off-by: Keir Fraser --- diff -r 0b8a9b22b70a -r 700f70b60d4b drivers/acpi/processor_idle.c --- a/drivers/acpi/processor_idle.c Fri Aug 19 09:53:47 2011 +0100 +++ b/drivers/acpi/processor_idle.c Sat Aug 27 12:12:38 2011 +0100 @@ -780,7 +780,7 @@ current_count)); /* Validate number of power states discovered */ - if (current_count < 2) + if (current_count < (processor_pm_external() ? 1 : 2)) status = -EFAULT; end: _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Mon Aug 29 23:44:22 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Mon, 29 Aug 2011 23:44:22 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyI3a-0005pA-2e; Mon, 29 Aug 2011 23:44:22 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyI3V-0005oa-3h for xen-changelog@lists.xensource.com; Mon, 29 Aug 2011 23:44:17 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-10.tower-21.messagelabs.com!1314686640!52160137!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11568 invoked from network); 30 Aug 2011 06:44:01 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 06:44:01 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyI3R-0005V3-H5 for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 07:44:13 +0100 Message-Id: Date: Tue, 30 Aug 2011 07:44:12 +0100 From: Xen patchbot-3.4-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-3.4-testing] libxc: [CVE-2011-1583] pv kernel image validation X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keith Coleman # Date 1314686158 14400 # Node ID 60b3ca4d973af88dbdb380c5d4b21a0a961459f5 # Parent 3b39c0fd26a6ee25e953ea0f2852c1253bd94c51 libxc: [CVE-2011-1583] pv kernel image validation The functions which interpret the kernel image supplied for a paravirtualised guest, and decompress it into memory when booting the domain, are incautious. Specifically: (i) Integer overflow in the decompression loop memory allocator might result in overrunning the buffer used for the decompressed image; (ii) Integer overflows and lack of checking of certain length fields can result in the loader reading its own address space beyond the size of the supplied kernel image file. (iii) Lack of error checking in the decompression loop can lead to an infinite loop. This patch fixes these problems. CVE-2011-1583. Signed-off-by: Ian Campbell Signed-off-by: Ian Jackson Committed-by: Keith Coleman --- diff -r 3b39c0fd26a6 -r 60b3ca4d973a tools/libxc/xc_dom_bzimageloader.c --- a/tools/libxc/xc_dom_bzimageloader.c Mon May 09 03:06:33 2011 -0400 +++ b/tools/libxc/xc_dom_bzimageloader.c Tue Aug 30 02:35:58 2011 -0400 @@ -68,8 +68,29 @@ for ( ; ; ) { ret = BZ2_bzDecompress(&stream); - if ( (stream.avail_out == 0) || (ret != BZ_OK) ) + if ( ret == BZ_STREAM_END ) { + xc_dom_printf("BZIP2: Saw data stream end\n"); + retval = 0; + break; + } + if ( ret != BZ_OK ) + { + xc_dom_printf("BZIP2: error %d", ret); + free(out_buf); + goto bzip2_cleanup; + } + + if ( stream.avail_out == 0 ) + { + /* Protect against output buffer overflow */ + if ( outsize > INT_MAX / 2 ) + { + xc_dom_printf("BZIP2: output buffer overflow\n"); + free(out_buf); + goto bzip2_cleanup; + } + tmp_buf = realloc(out_buf, outsize * 2); if ( tmp_buf == NULL ) { @@ -83,16 +104,18 @@ stream.avail_out = (outsize * 2) - outsize; outsize *= 2; } - - if ( ret != BZ_OK ) + else if ( stream.avail_in == 0 ) { - if ( ret == BZ_STREAM_END ) - { - xc_dom_printf("BZIP2: Saw data stream end\n"); - retval = 0; - break; - } - xc_dom_printf("BZIP2: error\n"); + /* + * If there is output buffer available then this indicates + * that BZ2_bzDecompress would like more input data to be + * provided. However our complete input buffer is in + * memory and provided upfront so if avail_in is zero this + * actually indicates a truncated input. + */ + xc_dom_printf("BZIP2: not enough input\n"); + free(out_buf); + goto bzip2_cleanup; } } @@ -187,31 +210,14 @@ for ( ; ; ) { ret = lzma_code(&stream, action); - if ( (stream.avail_out == 0) || (ret != LZMA_OK) ) + if ( ret == LZMA_STREAM_END ) { - tmp_buf = realloc(out_buf, outsize * 2); - if ( tmp_buf == NULL ) - { - xc_dom_printf("LZMA: Failed to realloc memory\n"); - free(out_buf); - goto lzma_cleanup; - } - out_buf = tmp_buf; - - stream.next_out = out_buf + outsize; - stream.avail_out = (outsize * 2) - outsize; - outsize *= 2; + xc_dom_printf("LZMA: Saw data stream end\n"); + retval = 0; + break; } - if ( ret != LZMA_OK ) { - if ( ret == LZMA_STREAM_END ) - { - xc_dom_printf("LZMA: Saw data stream end\n"); - retval = 0; - break; - } - switch ( ret ) { case LZMA_MEM_ERROR: @@ -245,7 +251,32 @@ } xc_dom_printf("%s: LZMA decompression error %s\n", __FUNCTION__, msg); - break; + free(out_buf); + goto lzma_cleanup; + } + + if ( stream.avail_out == 0 ) + { + /* Protect against output buffer overflow */ + if ( outsize > INT_MAX / 2 ) + { + xc_dom_printf("LZMA: output buffer overflow\n"); + free(out_buf); + goto lzma_cleanup; + } + + tmp_buf = realloc(out_buf, outsize * 2); + if ( tmp_buf == NULL ) + { + xc_dom_printf("LZMA: Failed to realloc memory"); + free(out_buf); + goto lzma_cleanup; + } + out_buf = tmp_buf; + + stream.next_out = out_buf + outsize; + stream.avail_out = (outsize * 2) - outsize; + outsize *= 2; } } @@ -314,18 +345,18 @@ extern struct xc_dom_loader elf_loader; -static unsigned int payload_offset(struct setup_header *hdr) +static int check_magic(struct xc_dom_image *dom, const void *magic, size_t len) { - unsigned int off; + if (len > dom->kernel_size) + return 0; - off = (hdr->setup_sects + 1) * 512; - off += hdr->payload_offset; - return off; + return (memcmp(dom->kernel_blob, magic, len) == 0); } static int xc_dom_probe_bzimage_kernel(struct xc_dom_image *dom) { struct setup_header *hdr; + uint64_t payload_offset, payload_length; int ret; if ( dom->kernel_blob == NULL ) @@ -358,10 +389,30 @@ return -EINVAL; } - dom->kernel_blob = dom->kernel_blob + payload_offset(hdr); - dom->kernel_size = hdr->payload_length; - if ( memcmp(dom->kernel_blob, "\037\213", 2) == 0 ) + /* upcast to 64 bits to avoid overflow */ + /* setup_sects is u8 and so cannot overflow */ + payload_offset = (hdr->setup_sects + 1) * 512; + payload_offset += hdr->payload_offset; + payload_length = hdr->payload_length; + + if ( payload_offset >= dom->kernel_size ) + { + xc_dom_panic(XC_INVALID_KERNEL, "%s: payload offset overflow", + __FUNCTION__); + return -EINVAL; + } + if ( (payload_offset + payload_length) > dom->kernel_size ) + { + xc_dom_panic(XC_INVALID_KERNEL, "%s: payload length overflow", + __FUNCTION__); + return -EINVAL; + } + + dom->kernel_blob = dom->kernel_blob + payload_offset; + dom->kernel_size = payload_length; + + if ( check_magic(dom, "\037\213", 2) ) { ret = xc_dom_try_gunzip(dom, &dom->kernel_blob, &dom->kernel_size); if ( ret == -1 ) @@ -372,7 +423,7 @@ return -EINVAL; } } - else if ( memcmp(dom->kernel_blob, "\102\132\150", 3) == 0 ) + else if ( check_magic(dom, "\102\132\150", 3) ) { ret = xc_try_bzip2_decode(dom, &dom->kernel_blob, &dom->kernel_size); if ( ret < 0 ) @@ -383,7 +434,7 @@ return -EINVAL; } } - else if ( memcmp(dom->kernel_blob, "\135\000", 2) == 0 ) + else if ( check_magic(dom, "\135\000", 2) ) { ret = xc_try_lzma_decode(dom, &dom->kernel_blob, &dom->kernel_size); if ( ret < 0 ) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 00:12:45 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 00:12:45 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyIV3-0006fW-9u; Tue, 30 Aug 2011 00:12:45 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyITd-0006M0-5F for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 00:11:17 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-9.tower-174.messagelabs.com!1314688273!23527985!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3135 invoked from network); 30 Aug 2011 07:11:14 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 07:11:14 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyITZ-00037A-72 for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 08:11:13 +0100 Message-Id: Date: Tue, 30 Aug 2011 08:11:12 +0100 From: Xen patchbot-3.4-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-3.4-testing] pv-grub: Fix for incorrect dom->p2m_host[] list initialization X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keith Coleman # Date 1314687909 14400 # Node ID 90a184da7b92039b6ee4642351fa898c64e92aa4 # Parent 60b3ca4d973af88dbdb380c5d4b21a0a961459f5 pv-grub: Fix for incorrect dom->p2m_host[] list initialization Introduction of Linux Kernel git commit ceefccc93932b920a8ec6f35f596db05202a12fe (x86: default CONFIG_PHYSICAL_START and CONFIG_PHYSICAL_ALIGN to 16 MB) revealed deeply hidden bug in pv-grub. During kernel load stage dom->p2m_host[] list has been incorrectly initialized. At the beginning of kernel load stage dom->p2m_host[] list is populated with current PFN->MFN layout. Later during memory allocation (memory is allocated page by page in kexec_allocate()) page order is changed to establish linear layout in new domain. It is done by exchanging subsequent MFNs with newly allocated MFNs. dom->p2m_host[] list is indexed by currently requested PFN (it is incremented from 0) and PFN of newly allocated paged. If PFN of newly allocated page is less than currently requested PFN then earlier allocated MFN is overwritten which leads to domain crash later. This patch corrects that issue. If PFN of newly allocated page is less then currently requested PFN then relevant PFN/MFN pair is properly calculated and usual exchange occurs later. Signed-off-by: Daniel Kiper Reviewed-by: Samuel Thibault Committed-by: Keith Coleman --- diff -r 60b3ca4d973a -r 90a184da7b92 stubdom/grub/kexec.c --- a/stubdom/grub/kexec.c Tue Aug 30 02:35:58 2011 -0400 +++ b/stubdom/grub/kexec.c Tue Aug 30 03:05:09 2011 -0400 @@ -48,6 +48,7 @@ static unsigned long *pages; static unsigned long *pages_mfns; +static xen_pfn_t *pages_moved2pfns; static unsigned long allocated; int pin_table(int xc_handle, unsigned int type, unsigned long mfn, @@ -80,6 +81,7 @@ pages = realloc(pages, new_allocated * sizeof(*pages)); pages_mfns = realloc(pages_mfns, new_allocated * sizeof(*pages_mfns)); + pages_moved2pfns = realloc(pages_moved2pfns, new_allocated * sizeof(*pages_moved2pfns)); for (i = allocated; i < new_allocated; i++) { /* Exchange old page of PFN i with a newly allocated page. */ xen_pfn_t old_mfn = dom->p2m_host[i]; @@ -91,6 +93,18 @@ new_pfn = PHYS_PFN(to_phys(pages[i])); pages_mfns[i] = new_mfn = pfn_to_mfn(new_pfn); + /* + * If PFN of newly allocated page (new_pfn) is less then currently + * requested PFN (i) then look for relevant PFN/MFN pair. In this + * situation dom->p2m_host[new_pfn] no longer contains proper MFN + * because original page with new_pfn was moved earlier + * to different location. + */ + for (; new_pfn < i; new_pfn = pages_moved2pfns[new_pfn]); + + /* Store destination PFN of currently requested page. */ + pages_moved2pfns[i] = new_pfn; + /* Put old page at new PFN */ dom->p2m_host[new_pfn] = old_mfn; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:22:22 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:22:22 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTt7-0004RL-Tv; Tue, 30 Aug 2011 12:22:22 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTsz-0004Pp-Kx for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:14 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-10.tower-216.messagelabs.com!1314732130!8414698!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21041 invoked from network); 30 Aug 2011 19:22:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsw-0004kK-EZ for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:10 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Update my email address in MAINTAINERS X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314360399 -3600 # Node ID 1ec46033135e3a9f8b24a3e67d560a7ff2a826d8 # Parent 33d161ba8a044e756357b601cf8153846fa6f1e5 Update my email address in MAINTAINERS Signed-off-by: Tim Deegan --- diff -r 33d161ba8a04 -r 1ec46033135e MAINTAINERS --- a/MAINTAINERS Fri Aug 26 13:00:52 2011 +0100 +++ b/MAINTAINERS Fri Aug 26 13:06:39 2011 +0100 @@ -108,7 +108,7 @@ F: tools/debugger/gdbsx/ KDD DEBUGGER -M: Tim Deegan +M: Tim Deegan S: Supported F: tools/debugger/kdd/ @@ -213,7 +213,7 @@ F: xen/include/asm-x86/* X86 MEMORY MANAGEMENT -M: Tim Deegan +M: Tim Deegan S: Supported F: xen/arch/x86/mm/ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:22:35 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:22:35 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTtL-0004UX-FN; Tue, 30 Aug 2011 12:22:35 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTsz-0004Po-Ca for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:14 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-10.tower-182.messagelabs.com!1314732130!16421778!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29941 invoked from network); 30 Aug 2011 19:22:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsv-0004k5-Tm for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:09 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:09 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m: use defines for page sizes X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Christoph Egger # Date 1314360052 -3600 # Node ID 33d161ba8a044e756357b601cf8153846fa6f1e5 # Parent 227130622561e20136a1ef56201fe65ead5a76e8 x86/mm/p2m: use defines for page sizes Use defines for page sizes instead of hardcoding the value. Signed-off-by: Christoph Egger Acked-by: Tim Deegan Committed-by: Tim Deegan --- diff -r 227130622561 -r 33d161ba8a04 xen/arch/x86/mm/p2m-pod.c --- a/xen/arch/x86/mm/p2m-pod.c Thu Aug 25 12:03:14 2011 +0100 +++ b/xen/arch/x86/mm/p2m-pod.c Fri Aug 26 13:00:52 2011 +0100 @@ -112,11 +112,11 @@ /* Then add the first one to the appropriate populate-on-demand list */ switch(order) { - case 9: + case PAGE_ORDER_2M: page_list_add_tail(page, &p2m->pod.super); /* lock: page_alloc */ p2m->pod.count += 1 << order; break; - case 0: + case PAGE_ORDER_4K: page_list_add_tail(page, &p2m->pod.single); /* lock: page_alloc */ p2m->pod.count += 1; break; @@ -143,11 +143,11 @@ struct page_info *p = NULL; int i; - if ( order == 9 && page_list_empty(&p2m->pod.super) ) + if ( order == PAGE_ORDER_2M && page_list_empty(&p2m->pod.super) ) { return NULL; } - else if ( order == 0 && page_list_empty(&p2m->pod.single) ) + else if ( order == PAGE_ORDER_4K && page_list_empty(&p2m->pod.single) ) { unsigned long mfn; struct page_info *q; @@ -168,12 +168,12 @@ switch ( order ) { - case 9: + case PAGE_ORDER_2M: BUG_ON( page_list_empty(&p2m->pod.super) ); p = page_list_remove_head(&p2m->pod.super); p2m->pod.count -= 1 << order; /* Lock: page_alloc */ break; - case 0: + case PAGE_ORDER_4K: BUG_ON( page_list_empty(&p2m->pod.single) ); p = page_list_remove_head(&p2m->pod.single); p2m->pod.count -= 1; @@ -206,17 +206,17 @@ int order; if ( (pod_target - p2m->pod.count) >= SUPERPAGE_PAGES ) - order = 9; + order = PAGE_ORDER_2M; else - order = 0; + order = PAGE_ORDER_4K; retry: - page = alloc_domheap_pages(d, order, 0); + page = alloc_domheap_pages(d, order, PAGE_ORDER_4K); if ( unlikely(page == NULL) ) { - if ( order == 9 ) + if ( order == PAGE_ORDER_2M ) { /* If we can't allocate a superpage, try singleton pages */ - order = 0; + order = PAGE_ORDER_4K; goto retry; } @@ -249,9 +249,9 @@ if ( (p2m->pod.count - pod_target) > SUPERPAGE_PAGES && !page_list_empty(&p2m->pod.super) ) - order = 9; + order = PAGE_ORDER_2M; else - order = 0; + order = PAGE_ORDER_4K; page = p2m_pod_cache_get(p2m, order); @@ -468,12 +468,12 @@ free_domheap_page(p); - p = alloc_domheap_page(d, 0); + p = alloc_domheap_page(d, PAGE_ORDER_4K); if ( unlikely(!p) ) return; p2m_lock(p2m); - p2m_pod_cache_add(p2m, p, 0); + p2m_pod_cache_add(p2m, p, PAGE_ORDER_4K); p2m_unlock(p2m); return; } @@ -688,7 +688,7 @@ } /* Try to remove the page, restoring old mapping if it fails. */ - set_p2m_entry(p2m, gfn, _mfn(0), 9, + set_p2m_entry(p2m, gfn, _mfn(0), PAGE_ORDER_2M, p2m_populate_on_demand, p2m->default_access); /* Make none of the MFNs are used elsewhere... for example, mapped @@ -739,7 +739,7 @@ /* Finally! We've passed all the checks, and can add the mfn superpage * back on the PoD cache, and account for the new p2m PoD entries */ - p2m_pod_cache_add(p2m, mfn_to_page(mfn0), 9); + p2m_pod_cache_add(p2m, mfn_to_page(mfn0), PAGE_ORDER_2M); p2m->pod.entry_count += SUPERPAGE_PAGES; out_reset: @@ -800,7 +800,7 @@ } /* Try to remove the page, restoring old mapping if it fails. */ - set_p2m_entry(p2m, gfns[i], _mfn(0), 0, + set_p2m_entry(p2m, gfns[i], _mfn(0), PAGE_ORDER_4K, p2m_populate_on_demand, p2m->default_access); /* See if the page was successfully unmapped. (Allow one refcount @@ -810,7 +810,8 @@ unmap_domain_page(map[i]); map[i] = NULL; - set_p2m_entry(p2m, gfns[i], mfns[i], 0, types[i], p2m->default_access); + set_p2m_entry(p2m, gfns[i], mfns[i], PAGE_ORDER_4K, + types[i], p2m->default_access); continue; } @@ -832,7 +833,8 @@ * check timing. */ if ( j < PAGE_SIZE/sizeof(*map[i]) ) { - set_p2m_entry(p2m, gfns[i], mfns[i], 0, types[i], p2m->default_access); + set_p2m_entry(p2m, gfns[i], mfns[i], PAGE_ORDER_4K, + types[i], p2m->default_access); } else { @@ -852,7 +854,7 @@ } /* Add to cache, and account for the new p2m PoD entry */ - p2m_pod_cache_add(p2m, mfn_to_page(mfns[i]), 0); + p2m_pod_cache_add(p2m, mfn_to_page(mfns[i]), PAGE_ORDER_4K); p2m->pod.entry_count++; } } @@ -867,7 +869,7 @@ if ( p2m->pod.reclaim_super == 0 ) { - p2m->pod.reclaim_super = (p2m->pod.max_guest>>9)<<9; + p2m->pod.reclaim_super = (p2m->pod.max_guest>>PAGE_ORDER_2M)<pod.reclaim_super -= SUPERPAGE_PAGES; } @@ -956,7 +958,7 @@ /* Because PoD does not have cache list for 1GB pages, it has to remap * 1GB region to 2MB chunks for a retry. */ - if ( order == 18 ) + if ( order == PAGE_ORDER_1G ) { gfn_aligned = (gfn >> order) << order; /* Note that we are supposed to call set_p2m_entry() 512 times to @@ -964,7 +966,7 @@ * set_p2m_entry() should automatically shatter the 1GB page into * 512 2MB pages. The rest of 511 calls are unnecessary. */ - set_p2m_entry(p2m, gfn_aligned, _mfn(0), 9, + set_p2m_entry(p2m, gfn_aligned, _mfn(0), PAGE_ORDER_2M, p2m_populate_on_demand, p2m->default_access); audit_p2m(p2m, 1); p2m_unlock(p2m); @@ -979,12 +981,12 @@ { /* If we're low, start a sweep */ - if ( order == 9 && page_list_empty(&p2m->pod.super) ) + if ( order == PAGE_ORDER_2M && page_list_empty(&p2m->pod.super) ) p2m_pod_emergency_sweep_super(p2m); if ( page_list_empty(&p2m->pod.single) && - ( ( order == 0 ) - || (order == 9 && page_list_empty(&p2m->pod.super) ) ) ) + ( ( order == PAGE_ORDER_4K ) + || (order == PAGE_ORDER_2M && page_list_empty(&p2m->pod.super) ) ) ) p2m_pod_emergency_sweep(p2m); } @@ -1046,13 +1048,13 @@ out_fail: return -1; remap_and_retry: - BUG_ON(order != 9); + BUG_ON(order != PAGE_ORDER_2M); spin_unlock(&d->page_alloc_lock); /* Remap this 2-meg region in singleton chunks */ gfn_aligned = (gfn>>order)<default_access); if ( tb_init_done ) { diff -r 227130622561 -r 33d161ba8a04 xen/arch/x86/mm/p2m-pt.c --- a/xen/arch/x86/mm/p2m-pt.c Thu Aug 25 12:03:14 2011 +0100 +++ b/xen/arch/x86/mm/p2m-pt.c Fri Aug 26 13:00:52 2011 +0100 @@ -121,12 +121,12 @@ p2m_free_entry(struct p2m_domain *p2m, l1_pgentry_t *p2m_entry, int page_order) { /* End if the entry is a leaf entry. */ - if ( page_order == 0 + if ( page_order == PAGE_ORDER_4K || !(l1e_get_flags(*p2m_entry) & _PAGE_PRESENT) || (l1e_get_flags(*p2m_entry) & _PAGE_PSE) ) return; - if ( page_order > 9 ) + if ( page_order > PAGE_ORDER_2M ) { l1_pgentry_t *l3_table = map_domain_page(l1e_get_pfn(*p2m_entry)); for ( int i = 0; i < L3_PAGETABLE_ENTRIES; i++ ) @@ -323,7 +323,7 @@ /* * Try to allocate 1GB page table if this feature is supported. */ - if ( page_order == 18 ) + if ( page_order == PAGE_ORDER_1G ) { l1_pgentry_t old_entry = l1e_empty(); p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn, @@ -373,7 +373,7 @@ PGT_l2_page_table) ) goto out; - if ( page_order == 0 ) + if ( page_order == PAGE_ORDER_4K ) { if ( !p2m_next_level(p2m, &table_mfn, &table, &gfn_remainder, gfn, L2_PAGETABLE_SHIFT - PAGE_SHIFT, @@ -399,7 +399,7 @@ p2m->write_p2m_entry(p2m, gfn, p2m_entry, table_mfn, entry_content, 1); /* NB: paging_write_p2m_entry() handles tlb flushes properly */ } - else if ( page_order == 9 ) + else if ( page_order == PAGE_ORDER_2M ) { l1_pgentry_t old_entry = l1e_empty(); p2m_entry = p2m_find_entry(table, &gfn_remainder, gfn, @@ -541,7 +541,7 @@ /* The read has succeeded, so we know that mapping exists */ if ( q != p2m_query ) { - if ( !p2m_pod_demand_populate(p2m, gfn, 18, q) ) + if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) ) goto pod_retry_l3; p2mt = p2m_invalid; printk("%s: Allocate 1GB failed!\n", __func__); @@ -735,7 +735,7 @@ { if ( q != p2m_query ) { - if ( !p2m_pod_demand_populate(p2m, gfn, 18, q) ) + if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) ) goto pod_retry_l3; } else @@ -771,7 +771,7 @@ { if ( q != p2m_query ) { if ( !p2m_pod_check_and_populate(p2m, gfn, - (l1_pgentry_t *)l2e, 9, q) ) + (l1_pgentry_t *)l2e, PAGE_ORDER_2M, q) ) goto pod_retry_l2; } else *t = p2m_populate_on_demand; @@ -803,7 +803,7 @@ { if ( q != p2m_query ) { if ( !p2m_pod_check_and_populate(p2m, gfn, - (l1_pgentry_t *)l1e, 0, q) ) + (l1_pgentry_t *)l1e, PAGE_ORDER_4K, q) ) goto pod_retry_l1; } else *t = p2m_populate_on_demand; diff -r 227130622561 -r 33d161ba8a04 xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Thu Aug 25 12:03:14 2011 +0100 +++ b/xen/arch/x86/mm/p2m.c Fri Aug 26 13:00:52 2011 +0100 @@ -149,10 +149,10 @@ while ( todo ) { if ( hap_enabled(d) ) - order = ( (((gfn | mfn_x(mfn) | todo) & ((1ul << 18) - 1)) == 0) && - hvm_hap_has_1gb(d) && opt_hap_1gb ) ? 18 : - ((((gfn | mfn_x(mfn) | todo) & ((1ul << 9) - 1)) == 0) && - hvm_hap_has_2mb(d) && opt_hap_2mb) ? 9 : 0; + order = ( (((gfn | mfn_x(mfn) | todo) & ((1ul << PAGE_ORDER_1G) - 1)) == 0) && + hvm_hap_has_1gb(d) && opt_hap_1gb ) ? PAGE_ORDER_1G : + ((((gfn | mfn_x(mfn) | todo) & ((1ul << PAGE_ORDER_2M) - 1)) == 0) && + hvm_hap_has_2mb(d) && opt_hap_2mb) ? PAGE_ORDER_2M : PAGE_ORDER_4K; else order = 0; diff -r 227130622561 -r 33d161ba8a04 xen/include/asm-x86/page.h --- a/xen/include/asm-x86/page.h Thu Aug 25 12:03:14 2011 +0100 +++ b/xen/include/asm-x86/page.h Fri Aug 26 13:00:52 2011 +0100 @@ -13,6 +13,10 @@ #define PAGE_MASK (~(PAGE_SIZE-1)) #define PAGE_FLAG_MASK (~0) +#define PAGE_ORDER_4K 0 +#define PAGE_ORDER_2M 9 +#define PAGE_ORDER_1G 18 + #ifndef __ASSEMBLY__ # include # include _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:22:43 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:22:43 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTtT-0004XU-EH; Tue, 30 Aug 2011 12:22:43 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTt0-0004Pr-QR for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:15 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-6.tower-174.messagelabs.com!1314732131!27536507!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24031 invoked from network); 30 Aug 2011 19:22:11 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:11 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsx-0004kn-Ck for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:11 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: work around certain Intel BIOSes causing (transient) hangs during boot X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1314443678 -3600 # Node ID e17f70940d1f57fe04dde3bf4e243f75c89f0d0e # Parent 4705eca37c9fac9d13867a856bdcfa8b7bad56c6 x86: work around certain Intel BIOSes causing (transient) hangs during boot They apparently leave the USB legacy emulation bits set in ICH10's SMI Control and Enable register, but fail to handle the resulting SMIs gracefully. The hangs can apparently extend indefinitely, but are commonly observed to last between a few seconds and a minute. This assumes that only ICH10-based systems on Intel main boards with Intel BIOS may be affected. Until Intel comes up with a more precise identification of affected BIOSes, all Intel ones on Intel boards will get this workaround applied. Signed-off-by: Jan Beulich --- diff -r 4705eca37c9f -r e17f70940d1f xen/arch/x86/dmi_scan.c --- a/xen/arch/x86/dmi_scan.c Sat Aug 27 12:13:39 2011 +0100 +++ b/xen/arch/x86/dmi_scan.c Sat Aug 27 12:14:38 2011 +0100 @@ -10,6 +10,8 @@ #include #include #include +#include +#include #define bt_ioremap(b,l) ((void *)__acpi_map_table(b,l)) #define bt_iounmap(b,l) ((void)0) @@ -278,6 +280,28 @@ return 0; } +static int __init ich10_bios_quirk(struct dmi_system_id *d) +{ + u32 port, smictl; + + if ( pci_conf_read16(0, 0x1f, 0, PCI_VENDOR_ID) != 0x8086 ) + return 0; + + switch ( pci_conf_read16(0, 0x1f, 0, PCI_DEVICE_ID) ) { + case 0x3a14: + case 0x3a16: + case 0x3a18: + case 0x3a1a: + port = (pci_conf_read16(0, 0x1f, 0, 0x40) & 0xff80) + 0x30; + smictl = inl(port); + /* turn off LEGACY_USB{,2}_EN if enabled */ + if ( smictl & 0x20008 ) + outl(smictl & ~0x20008, port); + break; + } + + return 0; +} #ifdef CONFIG_ACPI_SLEEP static __init int reset_videomode_after_s3(struct dmi_blacklist *d) @@ -342,6 +366,18 @@ } }, #endif + { ich10_bios_quirk, "Intel board & BIOS", + /* + * BIOS leaves legacy USB emulation enabled while + * SMM can't properly handle it. + */ + { + MATCH(DMI_BOARD_VENDOR, "Intel Corp"), + MATCH(DMI_BIOS_VENDOR, "Intel Corp"), + NO_MATCH, NO_MATCH + } + }, + #ifdef CONFIG_ACPI_BOOT /* * If your system is blacklisted here, but you find that acpi=force _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:22:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:22:50 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTtZ-0004aO-UO; Tue, 30 Aug 2011 12:22:49 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTt0-0004Ps-T0 for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:15 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-216.messagelabs.com!1314732131!16492342!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7592 invoked from network); 30 Aug 2011 19:22:12 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:12 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsx-0004l2-Sq for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:11 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86: drop unused parameter from msi_compose_msg() and setup_msi_irq() X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1314443707 -3600 # Node ID 4a59d5ff7b4df2b5801e09669c2539bd32979183 # Parent e17f70940d1f57fe04dde3bf4e243f75c89f0d0e x86: drop unused parameter from msi_compose_msg() and setup_msi_irq() This particularly eliminates the bogus passing of NULL by hpet.c. Signed-off-by: Jan Beulich --- diff -r e17f70940d1f -r 4a59d5ff7b4d xen/arch/x86/hpet.c --- a/xen/arch/x86/hpet.c Sat Aug 27 12:14:38 2011 +0100 +++ b/xen/arch/x86/hpet.c Sat Aug 27 12:15:07 2011 +0100 @@ -342,7 +342,7 @@ { struct msi_msg msg; - msi_compose_msg(NULL, irq, &msg); + msi_compose_msg(irq, &msg); hpet_msi_write(irq, &msg); } diff -r e17f70940d1f -r 4a59d5ff7b4d xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Sat Aug 27 12:14:38 2011 +0100 +++ b/xen/arch/x86/irq.c Sat Aug 27 12:15:07 2011 +0100 @@ -1670,7 +1670,7 @@ && !desc->chip_data->used_vectors ) desc->chip_data->used_vectors = &pdev->info.used_vectors; set_domain_irq_pirq(d, irq, info); - setup_msi_irq(pdev, msi_desc, irq); + setup_msi_irq(msi_desc, irq); spin_unlock_irqrestore(&desc->lock, flags); } else diff -r e17f70940d1f -r 4a59d5ff7b4d xen/arch/x86/msi.c --- a/xen/arch/x86/msi.c Sat Aug 27 12:14:38 2011 +0100 +++ b/xen/arch/x86/msi.c Sat Aug 27 12:15:07 2011 +0100 @@ -120,8 +120,7 @@ /* * MSI message composition */ -void msi_compose_msg(struct pci_dev *pdev, int irq, - struct msi_msg *msg) +void msi_compose_msg(int irq, struct msi_msg *msg) { unsigned dest; cpumask_t domain; @@ -414,11 +413,11 @@ return entry; } -int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq) +int setup_msi_irq(struct msi_desc *msidesc, int irq) { struct msi_msg msg; - msi_compose_msg(dev, irq, &msg); + msi_compose_msg(irq, &msg); set_irq_msi(msidesc); write_msi_msg(irq_desc[irq].msi_desc, &msg); diff -r e17f70940d1f -r 4a59d5ff7b4d xen/include/asm-x86/msi.h --- a/xen/include/asm-x86/msi.h Sat Aug 27 12:14:38 2011 +0100 +++ b/xen/include/asm-x86/msi.h Sat Aug 27 12:15:07 2011 +0100 @@ -81,7 +81,7 @@ extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc); extern void pci_disable_msi(struct msi_desc *desc); extern void pci_cleanup_msi(struct pci_dev *pdev); -extern int setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc, int irq); +extern int setup_msi_irq(struct msi_desc *desc, int irq); extern void teardown_msi_irq(int irq); extern int msi_free_vector(struct msi_desc *entry); extern int pci_restore_msi_state(struct pci_dev *pdev); @@ -221,6 +221,5 @@ __u32 hi_address; } __attribute__ ((packed)); -void msi_compose_msg(struct pci_dev *pdev, int irq, - struct msi_msg *msg); +void msi_compose_msg(int irq, struct msi_msg *); #endif /* __ASM_MSI_H */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:22:59 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:22:59 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTtj-0004dg-DE; Tue, 30 Aug 2011 12:22:59 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTt1-0004Pt-Fk for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:16 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-6.tower-182.messagelabs.com!1314732132!16427916!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13877 invoked from network); 30 Aug 2011 19:22:12 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:12 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsy-0004lH-Bm for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:12 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:11 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Config.mk: Include optional .config file *first* rather than *last* X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314444019 -3600 # Node ID 2c687e70a34390b05ed8df833bd121e6f650193d # Parent 4a59d5ff7b4df2b5801e09669c2539bd32979183 Config.mk: Include optional .config file *first* rather than *last* Allows the core of Config.mk to correctly respond to any configuration overrides specified in the .config file. Signed-off-by: Keir Fraser --- diff -r 4a59d5ff7b4d -r 2c687e70a343 Config.mk --- a/Config.mk Sat Aug 27 12:15:07 2011 +0100 +++ b/Config.mk Sat Aug 27 12:20:19 2011 +0100 @@ -1,5 +1,7 @@ # -*- mode: Makefile; -*- +-include $(XEN_ROOT)/.config + # A debug build of Xen and tools? debug ?= y @@ -223,5 +225,3 @@ ifeq ($(OCAML_TOOLS),y) OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n") endif - --include $(XEN_ROOT)/.config _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:23:07 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:23:07 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTtr-0004hF-4r; Tue, 30 Aug 2011 12:23:07 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTt1-0004Pv-RZ for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:16 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-9.tower-216.messagelabs.com!1314732132!16503624!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17510 invoked from network); 30 Aug 2011 19:22:12 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:12 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsy-0004lW-R4 for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:12 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:12 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Add missing 'break' statement. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Kaushik Kumar Ram # Date 1314367121 -3600 # Node ID 469aa1fbd843d0797345ebf1e3d6c6df27ce744b # Parent 1ec46033135e3a9f8b24a3e67d560a7ff2a826d8 Add missing 'break' statement. Without the 'break', assigning a pci device to a PV guest results in an abort, since the code always falls through to the default abort case in the switch statement. Signed-off-by: Kaushik Kumar Ram Acked-by: Ian Jackson Committed-by: Ian Jackson --- diff -r 1ec46033135e -r 469aa1fbd843 tools/libxl/libxl_pci.c --- a/tools/libxl/libxl_pci.c Fri Aug 26 13:06:39 2011 +0100 +++ b/tools/libxl/libxl_pci.c Fri Aug 26 14:58:41 2011 +0100 @@ -696,6 +696,7 @@ } } fclose(f); + break; } default: abort(); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:23:15 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:23:15 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTtz-0004kQ-3q; Tue, 30 Aug 2011 12:23:15 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTt2-0004Pw-F9 for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:17 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-216.messagelabs.com!1314732133!16475269!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15201 invoked from network); 30 Aug 2011 19:22:13 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:13 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsz-0004ll-BG for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:13 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:12 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] Merge X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Ian Jackson # Date 1314701218 -3600 # Node ID ac9aa65050e9abc8f1c12c8603acf3b99e22cddc # Parent 469aa1fbd843d0797345ebf1e3d6c6df27ce744b # Parent 2c687e70a34390b05ed8df833bd121e6f650193d Merge --- diff -r 469aa1fbd843 -r ac9aa65050e9 Config.mk --- a/Config.mk Fri Aug 26 14:58:41 2011 +0100 +++ b/Config.mk Tue Aug 30 11:46:58 2011 +0100 @@ -1,5 +1,7 @@ # -*- mode: Makefile; -*- +-include $(XEN_ROOT)/.config + # A debug build of Xen and tools? debug ?= y @@ -223,5 +225,3 @@ ifeq ($(OCAML_TOOLS),y) OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n") endif - --include $(XEN_ROOT)/.config diff -r 469aa1fbd843 -r ac9aa65050e9 xen/arch/x86/dmi_scan.c --- a/xen/arch/x86/dmi_scan.c Fri Aug 26 14:58:41 2011 +0100 +++ b/xen/arch/x86/dmi_scan.c Tue Aug 30 11:46:58 2011 +0100 @@ -10,6 +10,8 @@ #include #include #include +#include +#include #define bt_ioremap(b,l) ((void *)__acpi_map_table(b,l)) #define bt_iounmap(b,l) ((void)0) @@ -278,6 +280,28 @@ return 0; } +static int __init ich10_bios_quirk(struct dmi_system_id *d) +{ + u32 port, smictl; + + if ( pci_conf_read16(0, 0x1f, 0, PCI_VENDOR_ID) != 0x8086 ) + return 0; + + switch ( pci_conf_read16(0, 0x1f, 0, PCI_DEVICE_ID) ) { + case 0x3a14: + case 0x3a16: + case 0x3a18: + case 0x3a1a: + port = (pci_conf_read16(0, 0x1f, 0, 0x40) & 0xff80) + 0x30; + smictl = inl(port); + /* turn off LEGACY_USB{,2}_EN if enabled */ + if ( smictl & 0x20008 ) + outl(smictl & ~0x20008, port); + break; + } + + return 0; +} #ifdef CONFIG_ACPI_SLEEP static __init int reset_videomode_after_s3(struct dmi_blacklist *d) @@ -342,6 +366,18 @@ } }, #endif + { ich10_bios_quirk, "Intel board & BIOS", + /* + * BIOS leaves legacy USB emulation enabled while + * SMM can't properly handle it. + */ + { + MATCH(DMI_BOARD_VENDOR, "Intel Corp"), + MATCH(DMI_BIOS_VENDOR, "Intel Corp"), + NO_MATCH, NO_MATCH + } + }, + #ifdef CONFIG_ACPI_BOOT /* * If your system is blacklisted here, but you find that acpi=force diff -r 469aa1fbd843 -r ac9aa65050e9 xen/arch/x86/hpet.c --- a/xen/arch/x86/hpet.c Fri Aug 26 14:58:41 2011 +0100 +++ b/xen/arch/x86/hpet.c Tue Aug 30 11:46:58 2011 +0100 @@ -342,7 +342,7 @@ { struct msi_msg msg; - msi_compose_msg(NULL, irq, &msg); + msi_compose_msg(irq, &msg); hpet_msi_write(irq, &msg); } diff -r 469aa1fbd843 -r ac9aa65050e9 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Fri Aug 26 14:58:41 2011 +0100 +++ b/xen/arch/x86/irq.c Tue Aug 30 11:46:58 2011 +0100 @@ -1670,7 +1670,7 @@ && !desc->chip_data->used_vectors ) desc->chip_data->used_vectors = &pdev->info.used_vectors; set_domain_irq_pirq(d, irq, info); - setup_msi_irq(pdev, msi_desc, irq); + setup_msi_irq(msi_desc, irq); spin_unlock_irqrestore(&desc->lock, flags); } else diff -r 469aa1fbd843 -r ac9aa65050e9 xen/arch/x86/msi.c --- a/xen/arch/x86/msi.c Fri Aug 26 14:58:41 2011 +0100 +++ b/xen/arch/x86/msi.c Tue Aug 30 11:46:58 2011 +0100 @@ -120,8 +120,7 @@ /* * MSI message composition */ -void msi_compose_msg(struct pci_dev *pdev, int irq, - struct msi_msg *msg) +void msi_compose_msg(int irq, struct msi_msg *msg) { unsigned dest; cpumask_t domain; @@ -414,11 +413,11 @@ return entry; } -int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq) +int setup_msi_irq(struct msi_desc *msidesc, int irq) { struct msi_msg msg; - msi_compose_msg(dev, irq, &msg); + msi_compose_msg(irq, &msg); set_irq_msi(msidesc); write_msi_msg(irq_desc[irq].msi_desc, &msg); diff -r 469aa1fbd843 -r ac9aa65050e9 xen/arch/x86/x86_64/mmconfig_64.c --- a/xen/arch/x86/x86_64/mmconfig_64.c Fri Aug 26 14:58:41 2011 +0100 +++ b/xen/arch/x86/x86_64/mmconfig_64.c Tue Aug 30 11:46:58 2011 +0100 @@ -113,12 +113,11 @@ } static void __iomem *mcfg_ioremap(const struct acpi_mcfg_allocation *cfg, - unsigned int prot) + unsigned long idx, unsigned int prot) { unsigned long virt, size; - virt = PCI_MCFG_VIRT_START + - ((unsigned long)cfg->pci_segment << mmcfg_pci_segment_shift) + + virt = PCI_MCFG_VIRT_START + (idx << mmcfg_pci_segment_shift) + (cfg->start_bus_number << 20); size = (cfg->end_bus_number - cfg->start_bus_number + 1) << 20; if (virt + size < virt || virt + size > PCI_MCFG_VIRT_END) @@ -139,7 +138,7 @@ if (pci_mmcfg_virt[idx].virt) return 0; - pci_mmcfg_virt[idx].virt = mcfg_ioremap(cfg, PAGE_HYPERVISOR_NOCACHE); + pci_mmcfg_virt[idx].virt = mcfg_ioremap(cfg, idx, PAGE_HYPERVISOR_NOCACHE); if (!pci_mmcfg_virt[idx].virt) { printk(KERN_ERR "PCI: Cannot map MCFG aperture for segment %04x\n", cfg->pci_segment); @@ -160,7 +159,7 @@ * the necessary L4 entries get populated (so that they get properly * propagated to guest domains' page tables). */ - mcfg_ioremap(cfg, 0); + mcfg_ioremap(cfg, idx, 0); printk(KERN_WARNING "PCI: Not using MCFG for segment %04x bus %02x-%02x\n", cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number); } diff -r 469aa1fbd843 -r ac9aa65050e9 xen/include/asm-x86/msi.h --- a/xen/include/asm-x86/msi.h Fri Aug 26 14:58:41 2011 +0100 +++ b/xen/include/asm-x86/msi.h Tue Aug 30 11:46:58 2011 +0100 @@ -81,7 +81,7 @@ extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc); extern void pci_disable_msi(struct msi_desc *desc); extern void pci_cleanup_msi(struct pci_dev *pdev); -extern int setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc, int irq); +extern int setup_msi_irq(struct msi_desc *desc, int irq); extern void teardown_msi_irq(int irq); extern int msi_free_vector(struct msi_desc *entry); extern int pci_restore_msi_state(struct pci_dev *pdev); @@ -221,6 +221,5 @@ __u32 hi_address; } __attribute__ ((packed)); -void msi_compose_msg(struct pci_dev *pdev, int irq, - struct msi_msg *msg); +void msi_compose_msg(int irq, struct msi_msg *); #endif /* __ASM_MSI_H */ _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 12:23:27 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 12:23:27 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTuB-0004o4-QA; Tue, 30 Aug 2011 12:23:27 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyTt5-0004QU-7P for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 12:22:19 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-2.tower-182.messagelabs.com!1314732136!15438289!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26379 invoked from network); 30 Aug 2011 19:22:16 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 30 Aug 2011 19:22:16 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyTsw-0004kZ-Tm for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 20:22:10 +0100 Message-Id: Date: Tue, 30 Aug 2011 20:22:10 +0100 From: Xen patchbot-unstable To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-unstable] x86-64: allow mapping mmcfg space for high numbered PCI segments X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jan Beulich # Date 1314443619 -3600 # Node ID 4705eca37c9fac9d13867a856bdcfa8b7bad56c6 # Parent 1ec46033135e3a9f8b24a3e67d560a7ff2a826d8 x86-64: allow mapping mmcfg space for high numbered PCI segments Rather than using the segment number directly when determining the virtual address for a particular mmconfig block, use the array index instead. Thus a system with (perhaps significantly) less than 2048 PCI segments, but with some having numbers beyond 2047 can actually have all its mmconfig blocks mapped. Signed-off-by: Jan Beulich --- diff -r 1ec46033135e -r 4705eca37c9f xen/arch/x86/x86_64/mmconfig_64.c --- a/xen/arch/x86/x86_64/mmconfig_64.c Fri Aug 26 13:06:39 2011 +0100 +++ b/xen/arch/x86/x86_64/mmconfig_64.c Sat Aug 27 12:13:39 2011 +0100 @@ -113,12 +113,11 @@ } static void __iomem *mcfg_ioremap(const struct acpi_mcfg_allocation *cfg, - unsigned int prot) + unsigned long idx, unsigned int prot) { unsigned long virt, size; - virt = PCI_MCFG_VIRT_START + - ((unsigned long)cfg->pci_segment << mmcfg_pci_segment_shift) + + virt = PCI_MCFG_VIRT_START + (idx << mmcfg_pci_segment_shift) + (cfg->start_bus_number << 20); size = (cfg->end_bus_number - cfg->start_bus_number + 1) << 20; if (virt + size < virt || virt + size > PCI_MCFG_VIRT_END) @@ -139,7 +138,7 @@ if (pci_mmcfg_virt[idx].virt) return 0; - pci_mmcfg_virt[idx].virt = mcfg_ioremap(cfg, PAGE_HYPERVISOR_NOCACHE); + pci_mmcfg_virt[idx].virt = mcfg_ioremap(cfg, idx, PAGE_HYPERVISOR_NOCACHE); if (!pci_mmcfg_virt[idx].virt) { printk(KERN_ERR "PCI: Cannot map MCFG aperture for segment %04x\n", cfg->pci_segment); @@ -160,7 +159,7 @@ * the necessary L4 entries get populated (so that they get properly * propagated to guest domains' page tables). */ - mcfg_ioremap(cfg, 0); + mcfg_ioremap(cfg, idx, 0); printk(KERN_WARNING "PCI: Not using MCFG for segment %04x bus %02x-%02x\n", cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number); } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Tue Aug 30 17:55:17 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Tue, 30 Aug 2011 17:55:17 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1QyZ5I-0007H5-Uu; Tue, 30 Aug 2011 17:55:16 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1QyZ5G-0007GS-09 for xen-changelog@lists.xensource.com; Tue, 30 Aug 2011 17:55:14 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-11.tower-182.messagelabs.com!1314752110!16450220!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31170 invoked from network); 31 Aug 2011 00:55:10 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 00:55:10 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1QyZ5B-0001gC-V7 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:55:10 +0100 Message-Id: Date: Wed, 31 Aug 2011 01:55:08 +0100 From: Xen patchbot-4.0-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.0-testing] Update Xen version to 4.0.3-rc2-pre X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Keir Fraser # Date 1314283010 -3600 # Node ID 4b7b75ace86391ca337198857be65491adf08756 # Parent 3ee2f39a7f6812ce80ba96fe69746e049149d8fd Update Xen version to 4.0.3-rc2-pre --- diff -r 3ee2f39a7f68 -r 4b7b75ace863 xen/Makefile --- a/xen/Makefile Thu Aug 25 11:40:01 2011 +0100 +++ b/xen/Makefile Thu Aug 25 15:36:50 2011 +0100 @@ -2,7 +2,7 @@ # All other places this is stored (eg. compile.h) should be autogenerated. export XEN_VERSION = 4 export XEN_SUBVERSION = 0 -export XEN_EXTRAVERSION ?= .3-rc1$(XEN_VENDORVERSION) +export XEN_EXTRAVERSION ?= .3-rc2-pre$(XEN_VENDORVERSION) export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) -include xen-version _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:23:55 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:23:55 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg5T-0000mE-Dk; Wed, 31 Aug 2011 01:23:55 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3v-0000E0-1l for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:19 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-21.messagelabs.com!1314778903!58418560!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14974 invoked from network); 31 Aug 2011 08:21:43 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:21:43 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3r-0000QR-IZ for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:15 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:12 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] VT-d: Explicitly test EPT capabilities during IOMMU init X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314092600 -3600 # Node ID b42d905cd0321094011e5c3ae5133fe406a2e01c # Parent 007a4037900015b8fdd3978d1bdcbe7863d959f0 VT-d: Explicitly test EPT capabilities during IOMMU init because the cached version isn't set up until the EPT init happens. Signed-off-by: Tim Deegan xen-unstable changeset: 23787:41f00cf6b822 xen-unstable date: Tue Aug 23 10:43:20 2011 +0100 --- diff -r 007a40379000 -r b42d905cd032 xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Thu Aug 25 15:36:14 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Tue Aug 23 10:43:20 2011 +0100 @@ -1748,15 +1748,15 @@ static int vtd_ept_page_compatible(struct iommu *iommu) { - u64 cap = iommu->cap; + u64 ept_cap, vtd_cap = iommu->cap; - if ( ept_has_2mb(cpu_has_vmx_ept_2mb) != cap_sps_2mb(cap) ) + /* EPT is not initialised yet, so we must check the capability in + * the MSR explicitly rather than use cpu_has_vmx_ept_*() */ + if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 ) return 0; - if ( ept_has_1gb(cpu_has_vmx_ept_1gb) != cap_sps_1gb(cap) ) - return 0; - - return 1; + return ( ept_has_2mb(ept_cap) == cap_sps_2mb(vtd_cap) + && ept_has_1gb(ept_cap) == cap_sps_1gb(vtd_cap) ); } /* _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:24:06 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:24:06 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg5d-0000qO-IL; Wed, 31 Aug 2011 01:24:05 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3v-0000E2-BG for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:20 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-13.tower-182.messagelabs.com!1314778936!16330176!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28576 invoked from network); 31 Aug 2011 08:22:16 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:16 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3s-0000SR-6g for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:16 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:15 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] IOMMU: only try to share IOMMU and HAP tables for domains with P2M. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314092605 -3600 # Node ID 778723e052d5a67b4e44c8890af7e6cabb89343f # Parent b42d905cd0321094011e5c3ae5133fe406a2e01c IOMMU: only try to share IOMMU and HAP tables for domains with P2M. This makes the check more precise, and brings VTd in line with AMD code. Signed-off-by: Tim Deegan xen-unstable changeset: 23788:9d2a8912597d xen-unstable date: Tue Aug 23 10:43:25 2011 +0100 --- diff -r b42d905cd032 -r 778723e052d5 xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Tue Aug 23 10:43:25 2011 +0100 @@ -175,7 +175,7 @@ if ( has_arch_pdevs(d) && !need_iommu(d) ) { d->need_iommu = 1; - if ( !iommu_hap_pt_share ) + if ( !iommu_use_hap_pt(d) ) rc = iommu_populate_page_table(d); goto done; } diff -r b42d905cd032 -r 778723e052d5 xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Tue Aug 23 10:43:25 2011 +0100 @@ -1622,7 +1622,7 @@ if ( list_empty(&acpi_drhd_units) ) return; - if ( iommu_hap_pt_share ) + if ( iommu_use_hap_pt(d) ) return; spin_lock(&hd->mapping_lock); @@ -1644,7 +1644,7 @@ int iommu_domid; /* Do nothing if VT-d shares EPT page table */ - if ( iommu_hap_pt_share ) + if ( iommu_use_hap_pt(d) ) return 0; /* do nothing if dom0 and iommu supports pass thru */ @@ -1769,7 +1769,7 @@ ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled ); - if ( !iommu_hap_pt_share ) + if ( !iommu_use_hap_pt(d) ) return; pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))); diff -r b42d905cd032 -r 778723e052d5 xen/include/xen/iommu.h --- a/xen/include/xen/iommu.h Tue Aug 23 10:43:20 2011 +0100 +++ b/xen/include/xen/iommu.h Tue Aug 23 10:43:25 2011 +0100 @@ -34,6 +34,9 @@ extern bool_t amd_iommu_debug; extern bool_t amd_iommu_perdev_intremap; +/* Does this domain have a P2M table we can use as its IOMMU pagetable? */ +#define iommu_use_hap_pt(d) (paging_mode_hap(d) && iommu_hap_pt_share) + extern struct rangeset *mmio_ro_ranges; #define domain_hvm_iommu(d) (&d->arch.hvm_domain.hvm_iommu) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:24:26 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:24:26 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg5y-0000tf-Iu; Wed, 31 Aug 2011 01:24:26 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3w-0000EX-Ff for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:20 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-216.messagelabs.com!1314778937!16537425!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2503 invoked from network); 31 Aug 2011 08:22:17 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:17 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3t-0000UC-6d for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:17 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:16 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] x86/mm: Add iommu=sharept parameter for compatibility with 4.2 X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314361488 -3600 # Node ID 4cd50a27f7fbc18b2be28f70ab0283ec0e34b526 # Parent 19c47a4d7d370b42198b6e8d04644436cd0edb33 x86/mm: Add iommu=sharept parameter for compatibility with 4.2 Signed-off-by: Tim Deegan --- diff -r 19c47a4d7d37 -r 4cd50a27f7fb xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Tue Aug 23 10:54:27 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Fri Aug 26 13:24:48 2011 +0100 @@ -82,6 +82,8 @@ iommu_passthrough = 1; else if ( !strcmp(s, "dom0-strict") ) iommu_dom0_strict = 1; + else if ( !strcmp(s, "sharept") ) + iommu_hap_pt_share = 1; s = ss + 1; } while ( ss ); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:24:33 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:24:33 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg65-0000wu-Nu; Wed, 31 Aug 2011 01:24:33 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3w-0000EW-A2 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:20 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-6.tower-174.messagelabs.com!1314778936!27583156!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26617 invoked from network); 31 Aug 2011 08:22:17 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:17 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3s-0000TJ-MX for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:16 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:16 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Passthrough: fix iommu_use_hap_pt() to use hap_enabled() X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Tim Deegan # Date 1314093267 -3600 # Node ID 19c47a4d7d370b42198b6e8d04644436cd0edb33 # Parent 778723e052d5a67b4e44c8890af7e6cabb89343f Passthrough: fix iommu_use_hap_pt() to use hap_enabled() In line with 22924:86000076dcee, paging_mode_hap(d) shouldn't be used in HAP internals that are called during HAP setup. Signed-off-by: Tim Deegan xen-unstable changeset: 23789:1b77cf8305df xen-unstable date: Tue Aug 23 10:54:27 2011 +0100 --- diff -r 778723e052d5 -r 19c47a4d7d37 xen/include/xen/iommu.h --- a/xen/include/xen/iommu.h Tue Aug 23 10:43:25 2011 +0100 +++ b/xen/include/xen/iommu.h Tue Aug 23 10:54:27 2011 +0100 @@ -35,7 +35,7 @@ extern bool_t amd_iommu_perdev_intremap; /* Does this domain have a P2M table we can use as its IOMMU pagetable? */ -#define iommu_use_hap_pt(d) (paging_mode_hap(d) && iommu_hap_pt_share) +#define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share) extern struct rangeset *mmio_ro_ranges; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:24:40 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:24:40 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6B-0000zj-8n; Wed, 31 Aug 2011 01:24:39 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3x-0000Eo-7l for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:21 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-174.messagelabs.com!1314778937!29724148!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31517 invoked from network); 31 Aug 2011 08:22:18 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:18 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3t-0000V5-N8 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:17 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:17 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] /etc/init.d/xendomains relies on simple pattern matching from sructures X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User xl: improve compatibility with xm # Date 1314719680 -3600 # Node ID 3cad92b7ac91e5299fdf6d363e2b15892249ed1c # Parent 3fc53d38e619a0d9189418c56e888bcc8404a5f1 /etc/init.d/xendomains relies on simple pattern matching from sructures being printed by "xl list -l" command. so update xl implementation to match. Signed-off-by: Carsten Schiers Acked-by: Ian Jackson Committed-by: Ian Jackson xen-unstable changeset: 23567:c2995f0555af Backported-by: Carsten Schiers Committed-by: Ian Jackson --- diff -r 3fc53d38e619 -r 3cad92b7ac91 tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Thu Aug 25 11:38:43 2011 +0100 +++ b/tools/libxl/xl_cmdimpl.c Tue Aug 30 16:54:40 2011 +0100 @@ -293,7 +293,7 @@ libxl_domain_build_info *b_info = &d_config->b_info; printf("(domain\n\t(domid %d)\n", domid); - printf("\t(domain_create_info)\n"); + printf("\t(create_info)\n"); printf("\t(hvm %d)\n", c_info->hvm); printf("\t(hap %d)\n", c_info->hap); printf("\t(oos %d)\n", c_info->oos); @@ -320,7 +320,7 @@ printf("\t(platformdata (null))\n"); - printf("\t(domain_build_info)\n"); + printf("\t(build_info)\n"); printf("\t(max_vcpus %d)\n", b_info->max_vcpus); printf("\t(tsc_mode %d)\n", b_info->tsc_mode); printf("\t(max_memkb %d)\n", b_info->max_memkb); @@ -379,7 +379,7 @@ printf("\t(device\n"); printf("\t\t(tap\n"); printf("\t\t\t(backend_domid %d)\n", d_config->disks[i].backend_domid); - printf("\t\t\t(domid %d)\n", d_config->disks[i].domid); + printf("\t\t\t(frontend_domid %d)\n", d_config->disks[i].domid); printf("\t\t\t(physpath %s)\n", d_config->disks[i].pdev_path); printf("\t\t\t(phystype %d)\n", d_config->disks[i].backend); printf("\t\t\t(virtpath %s)\n", d_config->disks[i].vdev); @@ -394,7 +394,7 @@ printf("\t(device\n"); printf("\t\t(vif\n"); printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid); - printf("\t\t\t(domid %d)\n", d_config->vifs[i].domid); + printf("\t\t\t(frontend_domid %d)\n", d_config->vifs[i].domid); printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid); printf("\t\t\t(mtu %d)\n", d_config->vifs[i].mtu); printf("\t\t\t(model %s)\n", d_config->vifs[i].model); @@ -424,7 +424,7 @@ printf("\t(device\n"); printf("\t\t(vfb\n"); printf("\t\t\t(backend_domid %d)\n", d_config->vfbs[i].backend_domid); - printf("\t\t\t(domid %d)\n", d_config->vfbs[i].domid); + printf("\t\t\t(frontend_domid %d)\n", d_config->vfbs[i].domid); printf("\t\t\t(devid %d)\n", d_config->vfbs[i].devid); printf("\t\t\t(vnc %d)\n", d_config->vfbs[i].vnc); printf("\t\t\t(vnclisten %s)\n", d_config->vfbs[i].vnclisten); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:24:46 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:24:46 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6I-00012w-1U; Wed, 31 Aug 2011 01:24:46 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3x-0000F1-NC for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:22 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-15.tower-174.messagelabs.com!1314778938!23358417!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30811 invoked from network); 31 Aug 2011 08:22:18 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:18 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3u-0000W2-6f for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:18 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:17 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] tools: Improved LSB headers in init.d scripts X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Fabio Fantoni # Date 1314719782 -3600 # Node ID 2f2a75df40f65a2a27ee1b9f1cc8a8095ac191d7 # Parent 3cad92b7ac91e5299fdf6d363e2b15892249ed1c tools: Improved LSB headers in init.d scripts xendomains service now working also without xend service Signed-off-by: Fabio Fantoni Committed-by: Ian Jackson xen-unstable changeset: 23673:0648846b4d17 Backport-requested: Carsten Schiers Committed-by: Ian Jackson --- diff -r 3cad92b7ac91 -r 2f2a75df40f6 tools/hotplug/Linux/init.d/xen-watchdog --- a/tools/hotplug/Linux/init.d/xen-watchdog Tue Aug 30 16:54:40 2011 +0100 +++ b/tools/hotplug/Linux/init.d/xen-watchdog Tue Aug 30 16:56:22 2011 +0100 @@ -6,10 +6,10 @@ # description: Run domain watchdog daemon ### BEGIN INIT INFO # Provides: xen-watchdog -# Required-Start: xend -# Should-Start: $syslog $remote_fs -# Required-Stop: xend -# Should-Stop: $syslog $remote_fs +# Required-Start: $syslog $remote_fs +# Should-Start: xend +# Required-Stop: $syslog $remote_fs +# Should-Stop: xend # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/stop xen-watchdog diff -r 3cad92b7ac91 -r 2f2a75df40f6 tools/hotplug/Linux/init.d/xend --- a/tools/hotplug/Linux/init.d/xend Tue Aug 30 16:54:40 2011 +0100 +++ b/tools/hotplug/Linux/init.d/xend Tue Aug 30 16:56:22 2011 +0100 @@ -8,9 +8,9 @@ # description: Starts and stops the Xen control daemon. ### BEGIN INIT INFO # Provides: xend -# Required-Start: $syslog $remote_fs xenstored +# Required-Start: $syslog $remote_fs xenstored xenconsoled # Should-Start: -# Required-Stop: $syslog $remote_fs xenstored +# Required-Stop: $syslog $remote_fs xenstored xenconsoled # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 diff -r 3cad92b7ac91 -r 2f2a75df40f6 tools/hotplug/Linux/init.d/xendomains --- a/tools/hotplug/Linux/init.d/xendomains Tue Aug 30 16:54:40 2011 +0100 +++ b/tools/hotplug/Linux/init.d/xendomains Tue Aug 30 16:56:22 2011 +0100 @@ -16,10 +16,10 @@ # ### BEGIN INIT INFO # Provides: xendomains -# Required-Start: $syslog $remote_fs xend -# Should-Start: -# Required-Stop: $syslog $remote_fs xend -# Should-Stop: +# Required-Start: $syslog $remote_fs xenstored xenconsoled +# Should-Start: xend +# Required-Stop: $syslog $remote_fs xenstored xenconsoled +# Should-Stop: xend # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/stop secondary xen domains _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:24:51 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:24:51 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6N-00015y-MR; Wed, 31 Aug 2011 01:24:51 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3x-0000F2-Nd for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:22 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-13.tower-216.messagelabs.com!1314778938!16551461!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12376 invoked from network); 31 Aug 2011 08:22:18 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:18 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3u-0000Ww-Nd for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:18 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:18 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] xl: print sxp on dry-run of create. X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Ian Campbell # Date 1314719825 -3600 # Node ID 3ecd151a692514edf6f0ac2d2e88186953051651 # Parent 2f2a75df40f65a2a27ee1b9f1cc8a8095ac191d7 xl: print sxp on dry-run of create. The help text for xm create's --dry-run says "Dry run - prints the resulting configuration in SXP but does not create the domain." so update xl implementation to match. At least the xendomains initscript relies on this (for better or worse). Signed-off-by: Ian Campbell Tested-by: Carsten Schiers Acked-by: Ian Jackson Committed-by: Ian Jackson xen-unstable changeset: 23467:2ae357405850 Backport-requested: Carsten Schiers Committed-by: Ian Jackson --- diff -r 2f2a75df40f6 -r 3ecd151a6925 tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Tue Aug 30 16:56:22 2011 +0100 +++ b/tools/libxl/xl_cmdimpl.c Tue Aug 30 16:57:05 2011 +0100 @@ -1471,10 +1471,6 @@ parse_config_data(config_file, config_data, config_len, &d_config, &d_config.dm_info); - ret = 0; - if (dom_info->dryrun) - goto out; - if (migrate_fd >= 0) { if (d_config.c_info.name) { /* when we receive a domain we get its name from the config @@ -1493,9 +1489,13 @@ } } - if (debug) + if (debug || dom_info->dryrun) printf_info(-1, &d_config, &d_config.dm_info); + ret = 0; + if (dom_info->dryrun) + goto out; + start: domid = -1; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:24:58 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:24:58 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6U-000192-JH; Wed, 31 Aug 2011 01:24:58 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3y-0000FD-BM for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:22 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-5.tower-27.messagelabs.com!1314778923!42894279!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14215 invoked from network); 31 Aug 2011 08:22:03 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:03 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3v-0000Y1-8i for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:19 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:18 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] Merge X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Ian Jackson # Date 1314720153 -3600 # Node ID 20bc824fde06e6825ac61109eaa029211726a4e5 # Parent 3ecd151a692514edf6f0ac2d2e88186953051651 # Parent 4cd50a27f7fbc18b2be28f70ab0283ec0e34b526 Merge --- diff -r 3ecd151a6925 -r 20bc824fde06 xen/Makefile --- a/xen/Makefile Tue Aug 30 16:57:05 2011 +0100 +++ b/xen/Makefile Tue Aug 30 17:02:33 2011 +0100 @@ -2,7 +2,7 @@ # All other places this is stored (eg. compile.h) should be autogenerated. export XEN_VERSION = 4 export XEN_SUBVERSION = 1 -export XEN_EXTRAVERSION ?= .2-rc1$(XEN_VENDORVERSION) +export XEN_EXTRAVERSION ?= .2-rc2-pre$(XEN_VENDORVERSION) export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) -include xen-version diff -r 3ecd151a6925 -r 20bc824fde06 xen/drivers/passthrough/iommu.c --- a/xen/drivers/passthrough/iommu.c Tue Aug 30 16:57:05 2011 +0100 +++ b/xen/drivers/passthrough/iommu.c Tue Aug 30 17:02:33 2011 +0100 @@ -82,6 +82,8 @@ iommu_passthrough = 1; else if ( !strcmp(s, "dom0-strict") ) iommu_dom0_strict = 1; + else if ( !strcmp(s, "sharept") ) + iommu_hap_pt_share = 1; s = ss + 1; } while ( ss ); @@ -175,7 +177,7 @@ if ( has_arch_pdevs(d) && !need_iommu(d) ) { d->need_iommu = 1; - if ( !iommu_hap_pt_share ) + if ( !iommu_use_hap_pt(d) ) rc = iommu_populate_page_table(d); goto done; } diff -r 3ecd151a6925 -r 20bc824fde06 xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Tue Aug 30 16:57:05 2011 +0100 +++ b/xen/drivers/passthrough/vtd/iommu.c Tue Aug 30 17:02:33 2011 +0100 @@ -1622,7 +1622,7 @@ if ( list_empty(&acpi_drhd_units) ) return; - if ( iommu_hap_pt_share ) + if ( iommu_use_hap_pt(d) ) return; spin_lock(&hd->mapping_lock); @@ -1644,7 +1644,7 @@ int iommu_domid; /* Do nothing if VT-d shares EPT page table */ - if ( iommu_hap_pt_share ) + if ( iommu_use_hap_pt(d) ) return 0; /* do nothing if dom0 and iommu supports pass thru */ @@ -1748,15 +1748,15 @@ static int vtd_ept_page_compatible(struct iommu *iommu) { - u64 cap = iommu->cap; + u64 ept_cap, vtd_cap = iommu->cap; - if ( ept_has_2mb(cpu_has_vmx_ept_2mb) != cap_sps_2mb(cap) ) + /* EPT is not initialised yet, so we must check the capability in + * the MSR explicitly rather than use cpu_has_vmx_ept_*() */ + if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 ) return 0; - if ( ept_has_1gb(cpu_has_vmx_ept_1gb) != cap_sps_1gb(cap) ) - return 0; - - return 1; + return ( ept_has_2mb(ept_cap) == cap_sps_2mb(vtd_cap) + && ept_has_1gb(ept_cap) == cap_sps_1gb(vtd_cap) ); } /* @@ -1769,7 +1769,7 @@ ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled ); - if ( !iommu_hap_pt_share ) + if ( !iommu_use_hap_pt(d) ) return; pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))); diff -r 3ecd151a6925 -r 20bc824fde06 xen/include/xen/iommu.h --- a/xen/include/xen/iommu.h Tue Aug 30 16:57:05 2011 +0100 +++ b/xen/include/xen/iommu.h Tue Aug 30 17:02:33 2011 +0100 @@ -34,6 +34,9 @@ extern bool_t amd_iommu_debug; extern bool_t amd_iommu_perdev_intremap; +/* Does this domain have a P2M table we can use as its IOMMU pagetable? */ +#define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share) + extern struct rangeset *mmio_ro_ranges; #define domain_hvm_iommu(d) (&d->arch.hvm_domain.hvm_iommu) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:25:06 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:25:06 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6c-0001Co-70; Wed, 31 Aug 2011 01:25:06 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3y-0000FE-P0 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:23 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-12.tower-27.messagelabs.com!1314778927!40457726!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31756 invoked from network); 31 Aug 2011 08:22:07 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:07 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3v-0000Yu-Oq for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:19 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:19 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] remus: fix check for installed qdiscs on ifb X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Shriram Rajagopalan # Date 1314721002 -3600 # Node ID f829cb802b91313d17001c73b1b64e4172f1d290 # Parent 20bc824fde06e6825ac61109eaa029211726a4e5 remus: fix check for installed qdiscs on ifb current check includes ingress and pfifo_fast. Add mq to the list of allowed qdiscs already installed on ifb. This patch fixes cases where remus fails to start, due to an mq qdisc already present on the vif. Signed-off-by: Shriram Rajagopalan Committed-by: Ian Jackson xen-unstable changeset: 23109:c8ae80a11d47 Backport-requested: Shriram Rajagopalan Committed-by: Ian Jackson --- diff -r 20bc824fde06 -r f829cb802b91 tools/python/xen/remus/device.py --- a/tools/python/xen/remus/device.py Tue Aug 30 17:02:33 2011 +0100 +++ b/tools/python/xen/remus/device.py Tue Aug 30 17:16:42 2011 +0100 @@ -320,9 +320,9 @@ if q['kind'] == 'plug': self.installed = True return - if q['kind'] not in ('ingress', 'pfifo_fast'): + if q['kind'] not in ('ingress', 'pfifo_fast', 'mq'): raise BufferedNICException('there is already a queueing ' - 'discipline on %s' % devname) + 'discipline %s on %s' % (q['kind'], devname)) print ('installing buffer on %s... ' % devname), req = qdisc.addrequest(self.bufdevno, self.handle, self.q) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:25:14 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:25:14 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6k-0001Fl-38; Wed, 31 Aug 2011 01:25:14 -0700 Received: from mail216.messagelabs.com ([85.158.143.99]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3z-0000Fg-Q8 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:24 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-9.tower-216.messagelabs.com!1314778940!16550600!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4257 invoked from network); 31 Aug 2011 08:22:20 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:20 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3w-0000ae-Oj for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:20 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:20 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] remus: write circumlocution for try..except..finally X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Jinsong Liu # Date 1314721392 -3600 # Node ID a0fe53f00a7d0a352005c62c58e29161c266153d # Parent b29552e599c817b0e4debb239e79e21278130790 remus: write circumlocution for try..except..finally Parsing /otc/source/vtd/xen-unstable/tools/python/../../tools/libxl/libxl.idl File "/usr/lib64/python2.4/site-packages/xen/remus/save.py", line 169 finally: ^ SyntaxError: invalid syntax This was introduced in 23195:13ec53a59a42 It is a problem for Python 2.4 and earlier, only. So use try...(try...except)...finally as suggested by Ian Campbell. Signed-off-by: Liu, Jinsong Acked-by: Shriram Rajagopalan Acked-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson xen-unstable changeset: 23379:b04e57ec4671 Backport-requested-by: Shriram Rajagopalan Committed-by: Ian Jackson --- diff -r b29552e599c8 -r a0fe53f00a7d tools/python/xen/remus/save.py --- a/tools/python/xen/remus/save.py Tue Aug 30 17:23:10 2011 +0100 +++ b/tools/python/xen/remus/save.py Tue Aug 30 17:23:12 2011 +0100 @@ -161,11 +161,12 @@ self.checkpointer = xen.lowlevel.checkpoint.checkpointer() try: - self.checkpointer.open(self.vm.domid) - self.checkpointer.start(self.fd, self.suspendcb, self.resumecb, - self.checkpointcb, self.interval) - except xen.lowlevel.checkpoint.error, e: - raise CheckpointError(e) + try: + self.checkpointer.open(self.vm.domid) + self.checkpointer.start(self.fd, self.suspendcb, self.resumecb, + self.checkpointcb, self.interval) + except xen.lowlevel.checkpoint.error, e: + raise CheckpointError(e) finally: try: #errors in checkpoint close are not critical atm. self.checkpointer.close() _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:25:22 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:25:22 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6s-0001Iy-1F; Wed, 31 Aug 2011 01:25:22 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg3z-0000FT-E2 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:24 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-6.tower-182.messagelabs.com!1314778940!16471904!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20355 invoked from network); 31 Aug 2011 08:22:20 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:20 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3w-0000Zk-8K for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:20 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:19 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] remus: blackhole replication target X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Shriram Rajagopalan # Date 1314721390 -3600 # Node ID b29552e599c817b0e4debb239e79e21278130790 # Parent f829cb802b91313d17001c73b1b64e4172f1d290 remus: blackhole replication target The new --null option allows one to test and play with just the memory checkpointing and network buffering aspect of remus, without the need for a second host. The disk is not replicated. All replication data is sent to /dev/null. This option is pretty handy when a user wants to see the page churn for his workload or observe the latency hit though the latter will not be accurate. Signed-off-by: Shriram Rajagopalan Committed-by: Ian Jackson xen-unstable changeset: 23196:29d81623dc14 Backport-requested-by: Shriram Rajagopalan Committed-by: Ian Jackson --- diff -r f829cb802b91 -r b29552e599c8 tools/python/xen/remus/save.py --- a/tools/python/xen/remus/save.py Tue Aug 30 17:16:42 2011 +0100 +++ b/tools/python/xen/remus/save.py Tue Aug 30 17:23:10 2011 +0100 @@ -95,6 +95,12 @@ self.sock = sock super(MigrationSocket, self).__init__(fd) +class NullSocket(_proxy): + def __init__(self, address): + filedesc = os.open('/dev/null', 0666) + fd = os.fdopen(filedesc, 'w+') + super(NullSocket, self).__init__(fd) + class Keepalive(object): "Call a keepalive method at intervals" def __init__(self, method, interval=0.1): diff -r f829cb802b91 -r b29552e599c8 tools/remus/remus --- a/tools/remus/remus Tue Aug 30 17:16:42 2011 +0100 +++ b/tools/remus/remus Tue Aug 30 17:23:10 2011 +0100 @@ -21,6 +21,7 @@ self.domid = 0 self.host = 'localhost' + self.nullremus = False self.port = XendOptions.instance().get_xend_relocation_port() self.interval = 200 self.netbuffer = True @@ -33,6 +34,8 @@ help='checkpoint every MS milliseconds') parser.add_option('-p', '--port', dest='port', type='int', help='send stream to port PORT', metavar='PORT') + parser.add_option('', '--blackhole', dest='nullremus', action='store_true', + help='replicate to /dev/null (no disk checkpoints, only memory & net buffering)') parser.add_option('', '--no-net', dest='nonet', action='store_true', help='run without net buffering (benchmark option)') parser.add_option('', '--timer', dest='timer', action='store_true', @@ -49,6 +52,8 @@ self.interval = opts.interval if opts.port: self.port = opts.port + if opts.nullremus: + self.nullremus = True if opts.nonet: self.netbuffer = False if opts.timer: @@ -107,18 +112,22 @@ bufs = [] # disks must commit before network can be released - for disk in dom.disks: - try: - bufs.append(ReplicatedDisk(disk)) - except ReplicatedDiskException, e: - print e - continue + if not cfg.nullremus: + for disk in dom.disks: + try: + bufs.append(ReplicatedDisk(disk)) + except ReplicatedDiskException, e: + print e + continue if cfg.netbuffer: for vif in dom.vifs: bufs.append(BufferedNIC(vif)) - fd = save.MigrationSocket((cfg.host, cfg.port)) + if cfg.nullremus: + fd = save.NullSocket((cfg.host, cfg.port)) + else: + fd = save.MigrationSocket((cfg.host, cfg.port)) def postsuspend(): 'Begin external checkpointing after domain has paused' _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:25:28 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:25:28 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg6y-0001M8-47; Wed, 31 Aug 2011 01:25:28 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg40-0000GA-BR for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:24 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-3.tower-27.messagelabs.com!1314778921!37682542!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27928 invoked from network); 31 Aug 2011 08:22:01 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:01 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3x-0000bY-8g for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:21 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:20 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] tools: remus: support DRBD disk backends X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Shriram Rajagopalan # Date 1314721394 -3600 # Node ID 9a88c2604e59746f805f4200e845436045b5aaff # Parent a0fe53f00a7d0a352005c62c58e29161c266153d tools: remus: support DRBD disk backends DRBD disk backends can be used instead of tapdisk backends for Remus. This requires a Remus style disk replication protocol (asynchronous replication with output buffering at backup), that is not available in standard DRBD code. A modified version that supports this new replication protocol is available from git://aramis.nss.cs.ubc.ca/drbd-8.3-remus Use of DRBD disk backends provides a means for efficient resynchronization of data after the crashed machine comes back online. Since DRBD allows for online resynchronization, a DRBD backed Remus VM does not have to be stopped or shutdown while the disks are resynchronizing. Once resynchronization is complete, Remus can be started at will. Signed-off-by: Shriram Rajagopalan Committed-by: Ian Jackson xen-unstable changeset: 23413:62c0dfc9efbf Backport-requested-by: Shriram Rajagopalan Committed-by: Ian Jackson --- diff -r a0fe53f00a7d -r 9a88c2604e59 tools/python/xen/remus/device.py --- a/tools/python/xen/remus/device.py Tue Aug 30 17:23:12 2011 +0100 +++ b/tools/python/xen/remus/device.py Tue Aug 30 17:23:14 2011 +0100 @@ -2,7 +2,7 @@ # # Coordinates with devices at suspend, resume, and commit hooks -import os, re +import os, re, fcntl import netlink, qdisc, util @@ -30,22 +30,51 @@ is paused between epochs. """ FIFODIR = '/var/run/tap' + SEND_CHECKPOINT = 20 + WAIT_CHECKPOINT_ACK = 30 def __init__(self, disk): # look up disk, make sure it is tap:buffer, and set up socket # to request commits. self.ctlfd = None + self.msgfd = None + self.is_drbd = False + self.ackwait = False - if not disk.uname.startswith('tap:remus:') and not disk.uname.startswith('tap:tapdisk:remus:'): + if disk.uname.startswith('tap:remus:') or disk.uname.startswith('tap:tapdisk:remus:'): + fifo = re.match("tap:.*(remus.*)\|", disk.uname).group(1).replace(':', '_') + absfifo = os.path.join(self.FIFODIR, fifo) + absmsgfifo = absfifo + '.msg' + + self.installed = False + self.ctlfd = open(absfifo, 'w+b') + self.msgfd = open(absmsgfifo, 'r+b') + elif disk.uname.startswith('drbd:'): + #get the drbd device associated with this resource + drbdres = re.match("drbd:(.*)", disk.uname).group(1) + drbddev = util.runcmd("drbdadm sh-dev %s" % drbdres).rstrip() + + #check for remus supported drbd installation + rconf = util.runcmd("drbdsetup %s show" % drbddev) + if rconf.find('protocol D;') == -1: + raise ReplicatedDiskException('Remus support for DRBD disks requires the ' + 'resources to operate in protocol D. Please make ' + 'sure that you have installed the remus supported DRBD ' + 'version from git://aramis.nss.cs.ubc.ca/drbd-8.3-remus ' + 'and enabled protocol D in the resource config') + + #check if resource is in connected state + cstate = util.runcmd("drbdadm cstate %s" % drbdres).rstrip() + if cstate != 'Connected': + raise ReplicatedDiskException('DRBD resource %s is not in connected state!' + % drbdres) + + #open a handle to the resource so that we could issue chkpt ioctls + self.ctlfd = open(drbddev, 'r') + self.is_drbd = True + else: raise ReplicatedDiskException('Disk is not replicated: %s' % str(disk)) - fifo = re.match("tap:.*(remus.*)\|", disk.uname).group(1).replace(':', '_') - absfifo = os.path.join(self.FIFODIR, fifo) - absmsgfifo = absfifo + '.msg' - - self.installed = False - self.ctlfd = open(absfifo, 'w+b') - self.msgfd = open(absmsgfifo, 'r+b') def __del__(self): self.uninstall() @@ -56,12 +85,24 @@ self.ctlfd = None def postsuspend(self): - os.write(self.ctlfd.fileno(), 'flush') + if not self.is_drbd: + os.write(self.ctlfd.fileno(), 'flush') + elif not self.ackwait: + if (fcntl.ioctl(self.ctlfd.fileno(), self.SEND_CHECKPOINT, 0) > 0): + self.ackwait = False + else: + self.ackwait = True + + def preresume(self): + if self.is_drbd and self.ackwait: + fcntl.ioctl(self.ctlfd.fileno(), self.WAIT_CHECKPOINT_ACK, 0) + self.ackwait = False def commit(self): - msg = os.read(self.msgfd.fileno(), 4) - if msg != 'done': - print 'Unknown message: %s' % msg + if not self.is_drbd: + msg = os.read(self.msgfd.fileno(), 4) + if msg != 'done': + print 'Unknown message: %s' % msg ### Network _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:25:38 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:25:38 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg78-0001Pk-DC; Wed, 31 Aug 2011 01:25:38 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg40-0000GC-Tb for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:25 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-2.tower-182.messagelabs.com!1314778941!15484308!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3413 invoked from network); 31 Aug 2011 08:22:21 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:21 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3x-0000cO-OX for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:21 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:21 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] tools: remus: blktap2/block-remus.c - potential write-after-write race fix X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Shriram Rajagopalan # Date 1314721396 -3600 # Node ID 88ac7613a4f9233661792e36878d197b00f24f75 # Parent 9a88c2604e59746f805f4200e845436045b5aaff tools: remus: blktap2/block-remus.c - potential write-after-write race fix At the end of a checkpoint, when a new flush (of buffered disk writes) is merged with ongoing flush, we have to make sure that none of the new disk I/O requests overlap with ones in in progress. If it does, hold the request and dont issue I/O until the overlapping one finishes. If we allow the I/O to proceed, we might end up with two overlapping requests in the disk's queue and the disk may not offer any guarantee on which one is written first. Signed-off-by: Shriram Rajagopalan Committed-by: Ian Jackson xen-unstable changeset: 23414:ecff559bf474 Backport-requested-by: Shriram Rajagopalan Committed-by: Ian Jackson --- diff -r 9a88c2604e59 -r 88ac7613a4f9 tools/blktap2/drivers/block-remus.c --- a/tools/blktap2/drivers/block-remus.c Tue Aug 30 17:23:14 2011 +0100 +++ b/tools/blktap2/drivers/block-remus.c Tue Aug 30 17:23:16 2011 +0100 @@ -103,12 +103,24 @@ size_t sector_size; struct hashtable* h; /* when a ramdisk is flushed, h is given a new empty hash for writes - * while the old ramdisk (prev) is drained asynchronously. To avoid - * a race where a read request points to a sector in prev which has - * not yet been flushed, check prev on a miss in h */ + * while the old ramdisk (prev) is drained asynchronously. + */ struct hashtable* prev; /* count of outstanding requests to the base driver */ size_t inflight; + /* prev holds the requests to be flushed, while inprogress holds + * requests being flushed. When requests complete, they are removed + * from inprogress. + * Whenever a new flush is merged with ongoing flush (i.e, prev), + * we have to make sure that none of the new requests overlap with + * ones in "inprogress". If it does, keep it back in prev and dont issue + * IO until the current one finishes. If we allow this IO to proceed, + * we might end up with two "overlapping" requests in the disk's queue and + * the disk may not offer any guarantee on which one is written first. + * IOW, make sure we dont create a write-after-write time ordering constraint. + * + */ + struct hashtable* inprogress; }; /* the ramdisk intercepts the original callback for reads and writes. @@ -217,6 +229,8 @@ { return ring_next(ring, ring->tail) == ring->head; } +/* Prototype declarations */ +static int ramdisk_flush(td_driver_t *driver, struct tdremus_state* s); /* functions to create and sumbit treq's */ @@ -225,7 +239,8 @@ { struct tdremus_state *s = (struct tdremus_state *) treq.cb_data; td_vbd_request_t *vreq; - + int i; + uint64_t start; vreq = (td_vbd_request_t *) treq.private; /* the write failed for now, lets panic. this is very bad */ @@ -240,6 +255,13 @@ free(vreq); s->ramdisk.inflight--; + start = treq.sec; + for (i = 0; i < treq.secs; i++) { + hashtable_remove(s->ramdisk.inprogress, &start); + start++; + } + free(treq.buf); + if (!s->ramdisk.inflight && !s->ramdisk.prev) { /* TODO: the ramdisk has been flushed */ } @@ -281,9 +303,6 @@ } -/* ramdisk methods */ -static int ramdisk_flush(td_driver_t *driver, struct tdremus_state *s); - /* http://www.concentric.net/~Ttwang/tech/inthash.htm */ static unsigned int uint64_hash(void* k) { @@ -318,9 +337,10 @@ for (i = 0; i < nb_sectors; i++) { key = sector + i; - if (!(v = hashtable_search(ramdisk->h, &key))) { - /* check whether it is queued in a previous flush request */ - if (!(ramdisk->prev && (v = hashtable_search(ramdisk->prev, &key)))) + /* check whether it is queued in a previous flush request */ + if (!(ramdisk->prev && (v = hashtable_search(ramdisk->prev, &key)))) { + /* check whether it is an ongoing flush */ + if (!(ramdisk->inprogress && (v = hashtable_search(ramdisk->inprogress, &key)))) return -1; } memcpy(buf + i * ramdisk->sector_size, v, ramdisk->sector_size); @@ -377,40 +397,6 @@ return 0; } -static int ramdisk_write_cb(td_driver_t *driver, int res, uint64_t sector, - int nb_sectors, int id, void* private) -{ - struct ramdisk_write_cbdata *cbdata = (struct ramdisk_write_cbdata*)private; - struct tdremus_state *s = cbdata->state; - int rc; - - /* - RPRINTF("ramdisk write callback: rc %d, %d sectors @ %" PRIu64 "\n", res, nb_sectors, - sector); - */ - - free(cbdata->buf); - free(cbdata); - - s->ramdisk.inflight--; - if (!s->ramdisk.inflight && !s->ramdisk.prev) { - /* when this reaches 0 and prev is empty, the disk is flushed. */ - /* - RPRINTF("ramdisk flush complete\n"); - */ - } - - if (s->ramdisk.prev) { - /* resubmit as much as possible in the remaining disk */ - /* - RPRINTF("calling ramdisk_flush from write callback\n"); - */ - return ramdisk_flush(driver, s); - } - - return 0; -} - static int uint64_compare(const void* k1, const void* k2) { uint64_t u1 = *(uint64_t*)k1; @@ -447,31 +433,69 @@ return count; } -static char* merge_requests(struct ramdisk* ramdisk, uint64_t start, - size_t count) +/* + return -1 for OOM + return -2 for merge lookup failure + return -3 for WAW race + return 0 on success. +*/ +static int merge_requests(struct ramdisk* ramdisk, uint64_t start, + size_t count, char **mergedbuf) { char* buf; char* sector; int i; + uint64_t *key; + int rc = 0; if (!(buf = valloc(count * ramdisk->sector_size))) { DPRINTF("merge_request: allocation failed\n"); - return NULL; + return -1; } for (i = 0; i < count; i++) { if (!(sector = hashtable_search(ramdisk->prev, &start))) { DPRINTF("merge_request: lookup failed on %"PRIu64"\n", start); - return NULL; + free(buf); + rc = -2; + goto fail; } + /* Check inprogress requests to avoid waw non-determinism */ + if (hashtable_search(ramdisk->inprogress, &start)) { + DPRINTF("merge_request: WAR RACE on %"PRIu64"\n", start); + free(buf); + rc = -3; + goto fail; + } + /* Insert req into inprogress (brief period of duplication of hash entries until + * they are removed from prev. Read tracking would not be reading wrong entries) + */ + if (!(key = malloc(sizeof(*key)))) { + DPRINTF("%s: error allocating key\n", __FUNCTION__); + free(buf); + rc = -1; + goto fail; + } + *key = start; + if (!hashtable_insert(ramdisk->inprogress, key, NULL)) { + DPRINTF("%s failed to insert sector %" PRIu64 " into inprogress hash\n", + __FUNCTION__, start); + free(key); + free(buf); + rc = -1; + goto fail; + } memcpy(buf + i * ramdisk->sector_size, sector, ramdisk->sector_size); - free(sector); - start++; } - return buf; + *mergedbuf = buf; + return 0; +fail: + for (start--; i >0; i--, start--) + hashtable_remove(ramdisk->inprogress, &start); + return rc; } /* The underlying driver may not handle having the whole ramdisk queued at @@ -490,6 +514,12 @@ if ((count = ramdisk_get_sectors(s->ramdisk.prev, §ors)) <= 0) return count; + /* Create the inprogress table if empty */ + if (!s->ramdisk.inprogress) + s->ramdisk.inprogress = create_hashtable(RAMDISK_HASHSIZE, + uint64_hash, + rd_hash_equal); + /* RPRINTF("ramdisk: flushing %d sectors\n", count); */ @@ -503,8 +533,12 @@ i++; batchlen = sectors[i-1] - base + 1; - if (!(buf = merge_requests(&s->ramdisk, base, batchlen))) { - RPRINTF("ramdisk_flush: merge_requests failed\n"); + j = merge_requests(&s->ramdisk, base, batchlen, &buf); + + if (j) { + RPRINTF("ramdisk_flush: merge_requests failed:%s\n", + j == -1? "OOM": (j==-2? "missing sector" : "WAW race")); + if (j == -3) continue; free(sectors); return -1; } @@ -518,6 +552,8 @@ s->ramdisk.inflight++; for (j = 0; j < batchlen; j++) { + buf = hashtable_search(s->ramdisk.prev, &base); + free(buf); hashtable_remove(s->ramdisk.prev, &base); base++; } @@ -864,6 +900,18 @@ return 0; } +static int server_flush(td_driver_t *driver) +{ + struct tdremus_state *s = (struct tdremus_state *)driver->data; + /* + * Nothing to flush in beginning. + */ + if (!s->ramdisk.prev) + return 0; + /* Try to flush any remaining requests */ + return ramdisk_flush(driver, s); +} + static int primary_start(td_driver_t *driver) { struct tdremus_state *s = (struct tdremus_state *)driver->data; @@ -1103,18 +1151,18 @@ void backup_queue_read(td_driver_t *driver, td_request_t treq) { struct tdremus_state *s = (struct tdremus_state *)driver->data; - + int i; if(!remus_image) remus_image = treq.image; - -#if 0 - /* due to prefetching, we must return EBUSY on server reads. This - * maintains a consistent disk image */ - td_complete_request(treq, -EBUSY); -#else - /* what exactly is the race that requires the response above? */ - td_forward_request(treq); -#endif + + /* check if this read is queued in any currently ongoing flush */ + if (ramdisk_read(&s->ramdisk, treq.sec, treq.secs, treq.buf)) { + /* TODO: Add to pending read hash */ + td_forward_request(treq); + } else { + /* complete the request */ + td_complete_request(treq, 0); + } } /* see above */ @@ -1142,6 +1190,7 @@ tapdisk_remus.td_queue_read = backup_queue_read; tapdisk_remus.td_queue_write = backup_queue_write; + s->queue_flush = server_flush; /* TODO set flush function */ return 0; } @@ -1257,8 +1306,13 @@ /* wait for previous ramdisk to flush before servicing reads */ if (server_writes_inflight(driver)) { - /* for now lets just return EBUSY. if this becomes an issue we can - * do something smarter */ + /* for now lets just return EBUSY. + * if there are any left-over requests in prev, + * kick em again. + */ + if(!s->ramdisk.inflight) /* nothing in inprogress */ + ramdisk_flush(driver, s); + td_complete_request(treq, -EBUSY); } else { @@ -1275,10 +1329,13 @@ /* wait for previous ramdisk to flush */ if (server_writes_inflight(driver)) { RPRINTF("queue_write: waiting for queue to drain"); + if(!s->ramdisk.inflight) /* nothing in inprogress. Kick prev */ + ramdisk_flush(driver, s); td_complete_request(treq, -EBUSY); } else { // RPRINTF("servicing write request on backup\n"); + /* NOTE: DRBD style bitmap tracking could go here */ td_forward_request(treq); } } @@ -1632,7 +1689,9 @@ struct tdremus_state *s = (struct tdremus_state *)driver->data; RPRINTF("closing\n"); - + if (s->ramdisk.inprogress) + hashtable_destroy(s->ramdisk.inprogress, 0); + if (s->driver_data) { free(s->driver_data); s->driver_data = NULL; _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:25:44 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:25:44 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg7E-0001Sl-Qh; Wed, 31 Aug 2011 01:25:44 -0700 Received: from mail21.messagelabs.com ([85.158.143.35]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg41-0000GL-95 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:25 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-14.tower-21.messagelabs.com!1314778934!57781460!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28325 invoked from network); 31 Aug 2011 08:22:14 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:14 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3y-0000dE-7z for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:22 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:21 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] remus: handle exceptions while installing/unstalling net buffer X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Signed-off-by: Shriram Rajagopalan # Date 1314721399 -3600 # Node ID e5dd58f9bee1d7c96f3595c2548ae96366154421 # Parent 88ac7613a4f9233661792e36878d197b00f24f75 remus: handle exceptions while installing/unstalling net buffer Signed-off-by: Shriram Rajagopalan Acked-by: Ian Jackson Committed-by: Ian Jackson xen-unstable changeset: 23600:15fc211a13bf Backport-requested-by: Shriram Rajagopalan Committed-by: Ian Jackson --- diff -r 88ac7613a4f9 -r e5dd58f9bee1 tools/python/xen/remus/device.py --- a/tools/python/xen/remus/device.py Tue Aug 30 17:23:16 2011 +0100 +++ b/tools/python/xen/remus/device.py Tue Aug 30 17:23:19 2011 +0100 @@ -169,15 +169,25 @@ self.vif = vif # voodoo from http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb#Typical_Usage util.runcmd('ip link set %s up' % self.devname) - util.runcmd('tc qdisc add dev %s ingress' % vif.dev) + try: + util.runcmd('tc qdisc add dev %s ingress' % vif.dev) + except util.PipeException, e: + # check if error indicates that ingress qdisc + # already exists on the vif. If so, ignore it. + ignoreme = 'RTNETLINK answers: File exists' + if ignoreme in str(e): + pass + else: + raise e util.runcmd('tc filter add dev %s parent ffff: proto ip pref 10 ' 'u32 match u32 0 0 action mirred egress redirect ' 'dev %s' % (vif.dev, self.devname)) def uninstall(self): - util.runcmd('tc filter del dev %s parent ffff: proto ip pref 10 u32' \ - % self.vif.dev) - util.runcmd('tc qdisc del dev %s ingress' % self.vif.dev) + try: + util.runcmd('tc qdisc del dev %s ingress' % self.vif.dev) + except util.PipeException, e: + pass util.runcmd('ip link set %s down' % self.devname) class IMQBuffer(Netbuf): @@ -373,9 +383,15 @@ def uninstall(self): if self.installed: - req = qdisc.delrequest(self.bufdevno, self.handle) - self.rth.talk(req.pack()) + try: + req = qdisc.delrequest(self.bufdevno, self.handle) + self.rth.talk(req.pack()) + except IOError, e: + pass self.installed = False - self.bufdev.uninstall() - self.pool.put(self.bufdev) + try: + self.bufdev.uninstall() + except util.PipeException, e: + pass + self.pool.put(self.bufdev) diff -r 88ac7613a4f9 -r e5dd58f9bee1 tools/python/xen/remus/util.py --- a/tools/python/xen/remus/util.py Tue Aug 30 17:23:16 2011 +0100 +++ b/tools/python/xen/remus/util.py Tue Aug 30 17:23:19 2011 +0100 @@ -65,8 +65,10 @@ proc.wait() if proc.returncode: print ' '.join(args) - print stderr.strip() - raise PipeException('%s failed' % args[0], proc.returncode) + errmsg = stderr.strip() + print errmsg + raise PipeException('%s failed (errmsg: %s)' % (args[0], errmsg), + proc.returncode) return stdout except (OSError, IOError), inst: raise PipeException('could not run %s' % args[0], inst.errno) _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:25:50 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:25:50 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg7K-0001Vv-Fl; Wed, 31 Aug 2011 01:25:50 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg42-0000Gy-AV for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:26 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-15.tower-174.messagelabs.com!1314778942!23358436!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31182 invoked from network); 31 Aug 2011 08:22:23 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:23 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3y-0000e6-Nx for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:22 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:22 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] libxl: Remove frontend and backend devices from xenstore after destroy X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Marek Marczykowski # Date 1307285159 -7200 # Node ID d4d0621cf325d8a9efb1c5ea91c2a5a909954932 # Parent e5dd58f9bee1d7c96f3595c2548ae96366154421 libxl: Remove frontend and backend devices from xenstore after destroy Cleanup frontend and backend devices from xenstore for all dev types - not only disks. Because backend cleanup moved to libxl__device_destroy, libxl__devices_destroy is somehow simpler. Signed-off-by: Marek Marczykowski xen-unstable changest: 23605:ff8d170852b3 Backport-requested-by: Marek Marczykowski Committed-by: Ian Jackson --- diff -r e5dd58f9bee1 -r d4d0621cf325 tools/libxl/libxl_device.c --- a/tools/libxl/libxl_device.c Tue Aug 30 17:23:19 2011 +0100 +++ b/tools/libxl/libxl_device.c Sun Jun 05 16:45:59 2011 +0200 @@ -269,7 +269,9 @@ if (!force) { xs_watch(ctx->xsh, state_path, be_path); rc = 1; - } + } else { + xs_rm(ctx->xsh, XBT_NULL, be_path); + } out: libxl__free_all(&gc); return rc; @@ -310,10 +312,8 @@ char *path, *be_path, *fe_path; unsigned int num1, num2; char **l1 = NULL, **l2 = NULL; - int i, j, n = 0, n_watches = 0; - flexarray_t *toremove; + int i, j, n_watches = 0; - toremove = flexarray_make(16, 1); path = libxl__sprintf(&gc, "/local/domain/%d/device", domid); l1 = libxl__xs_directory(&gc, XBT_NULL, path, &num1); if (!l1) { @@ -337,7 +337,6 @@ if (be_path != NULL) { if (libxl__device_destroy(ctx, be_path, force) > 0) n_watches++; - flexarray_set(toremove, n++, libxl__dirname(&gc, be_path)); } else { xs_rm(ctx->xsh, XBT_NULL, path); } @@ -350,7 +349,6 @@ if (be_path && strcmp(be_path, "")) { if (libxl__device_destroy(ctx, be_path, force) > 0) n_watches++; - flexarray_set(toremove, n++, libxl__dirname(&gc, be_path)); } if (!force) { @@ -370,12 +368,7 @@ } } } - for (i = 0; i < n; i++) { - flexarray_get(toremove, i, (void**) &path); - xs_rm(ctx->xsh, XBT_NULL, path); - } out: - flexarray_free(toremove); libxl__free_all(&gc); return 0; } @@ -401,6 +394,7 @@ (void)wait_for_dev_destroy(ctx, &tv); } + xs_rm(ctx->xsh, XBT_NULL, libxl__device_frontend_path(&gc, dev)); rc = 0; out: _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:26:04 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:26:04 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg7X-0001aC-SV; Wed, 31 Aug 2011 01:26:03 -0700 Received: from mail27.messagelabs.com ([193.109.254.147]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg42-0000H0-O2 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:28 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-13.tower-27.messagelabs.com!1314778933!38064392!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21736 invoked from network); 31 Aug 2011 08:22:13 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:13 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3z-0000fs-O2 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:23 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:23 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] libxl: Allocate memory for strings in libxl_device_disk X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Marek Marczykowski # Date 1306962954 -7200 # Node ID 2acda7c975996f8b10b3b18affcb0aed4b860a40 # Parent 1fc844ffd99b22870b94b2da04a274d1d97a06de libxl: Allocate memory for strings in libxl_device_disk Memory for strings in libxl_device_disk must be allocated from outside of libxl__gc to not be freed at the end of function (by libxl__free_all). Fixes xl block-detach Signed-off-by: Marek Marczykowski xen-unstable changest: 23603:6656d80b4de4 Backport-requested-by: Marek Marczykowski Committed-by: Ian Jackson --- diff -r 1fc844ffd99b -r 2acda7c97599 tools/libxl/libxl_utils.c --- a/tools/libxl/libxl_utils.c Sun Jun 05 16:48:17 2011 +0200 +++ b/tools/libxl/libxl_utils.c Wed Jun 01 23:15:54 2011 +0200 @@ -551,10 +551,10 @@ disk->backend_domid = strtoul(val, NULL, 10); disk->domid = domid; be_path = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/backend", diskpath)); - disk->pdev_path = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/params", be_path)); + disk->pdev_path = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(&gc, "%s/params", be_path), NULL); val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/type", be_path)); libxl_string_to_backend(ctx, val, &(disk->backend)); - disk->vdev = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/dev", be_path)); + disk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(&gc, "%s/dev", be_path), NULL); val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/removable", be_path)); disk->unpluggable = !strcmp(val, "1"); val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/mode", be_path)); _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:26:13 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:26:13 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg7g-0001dP-KP; Wed, 31 Aug 2011 01:26:13 -0700 Received: from mail182.messagelabs.com ([85.158.139.83]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg43-0000HK-Bm for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:28 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-7.tower-182.messagelabs.com!1314778944!11479911!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2239 invoked from network); 31 Aug 2011 08:22:24 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:24 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg40-0000gk-81 for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:24 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:23 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] xen.lowlevel.xl: Return None on empty domain name X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Marek Marczykowski # Date 1307285583 -7200 # Node ID e606d167fc00de40685c52618c33a54f7a445825 # Parent 2acda7c975996f8b10b3b18affcb0aed4b860a40 xen.lowlevel.xl: Return None on empty domain name Previously PyString_FromString(NULL) was called, which caused assertion failure. Signed-off-by: Marek Marczykowski xen-unstable changest: 23606:cc2f376d0cd9 Backport-requested-by: Marek Marczykowski Committed-by: Ian Jackson --- diff -r 2acda7c97599 -r e606d167fc00 tools/python/xen/lowlevel/xl/xl.c --- a/tools/python/xen/lowlevel/xl/xl.c Wed Jun 01 23:15:54 2011 +0200 +++ b/tools/python/xen/lowlevel/xl/xl.c Sun Jun 05 16:53:03 2011 +0200 @@ -412,14 +412,16 @@ { char *domname; int domid; - PyObject *ret; + PyObject *ret = Py_None; if ( !PyArg_ParseTuple(args, "i", &domid) ) return NULL; domname = libxl_domid_to_name(&self->ctx, domid); - ret = PyString_FromString(domname); - free(domname); + if (domname) { + ret = PyString_FromString(domname); + free(domname); + } return ret; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:26:20 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:26:20 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg7o-0001gS-9q; Wed, 31 Aug 2011 01:26:20 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg42-0000H1-Sy for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:28 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-15.tower-174.messagelabs.com!1314778943!23358438!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31223 invoked from network); 31 Aug 2011 08:22:23 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:23 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg3z-0000ez-7w for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:23 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:22 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] libxl: Accept disk name in libxl_devid_to_device_disk X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Marek Marczykowski # Date 1307285297 -7200 # Node ID 1fc844ffd99b22870b94b2da04a274d1d97a06de # Parent d4d0621cf325d8a9efb1c5ea91c2a5a909954932 libxl: Accept disk name in libxl_devid_to_device_disk Accept disk name in xl block-detach. Signed-off-by: Marek Marczykowski xen-unstable changest: 23604:5d7998be2252 Backport-requested-by: Marek Marczykowski Committed-by: Ian Jackson --- diff -r d4d0621cf325 -r 1fc844ffd99b tools/libxl/libxl_device.c --- a/tools/libxl/libxl_device.c Sun Jun 05 16:45:59 2011 +0200 +++ b/tools/libxl/libxl_device.c Sun Jun 05 16:48:17 2011 +0200 @@ -201,7 +201,7 @@ return 1; } -int libxl__device_disk_dev_number(char *virtpath) +int libxl__device_disk_dev_number(const char *virtpath) { int disk, partition; char *ep; diff -r d4d0621cf325 -r 1fc844ffd99b tools/libxl/libxl_internal.h --- a/tools/libxl/libxl_internal.h Sun Jun 05 16:45:59 2011 +0200 +++ b/tools/libxl/libxl_internal.h Sun Jun 05 16:48:17 2011 +0200 @@ -182,7 +182,7 @@ _hidden char *libxl__device_disk_string_of_format(libxl_disk_format format); _hidden int libxl__device_physdisk_major_minor(const char *physpath, int *major, int *minor); -_hidden int libxl__device_disk_dev_number(char *virtpath); +_hidden int libxl__device_disk_dev_number(const char *virtpath); _hidden int libxl__device_generic_add(libxl_ctx *ctx, libxl__device *device, char **bents, char **fents); diff -r d4d0621cf325 -r 1fc844ffd99b tools/libxl/libxl_utils.c --- a/tools/libxl/libxl_utils.c Sun Jun 05 16:45:59 2011 +0200 +++ b/tools/libxl/libxl_utils.c Sun Jun 05 16:48:17 2011 +0200 @@ -529,18 +529,18 @@ const char *devid, libxl_device_disk *disk) { libxl__gc gc = LIBXL_INIT_GC(ctx); - char *endptr, *val; + char *val; char *dompath, *diskpath, *be_path; unsigned int devid_n; int rc = ERROR_INVAL; - devid_n = strtoul(devid, &endptr, 10); - if (devid == endptr) { + devid_n = libxl__device_disk_dev_number(devid); + if (devid_n < 0) { goto out; } rc = ERROR_FAIL; dompath = libxl__xs_get_dompath(&gc, domid); - diskpath = libxl__sprintf(&gc, "%s/device/vbd/%s", dompath, devid); + diskpath = libxl__sprintf(&gc, "%s/device/vbd/%d", dompath, devid_n); if (!diskpath) { goto out; } _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog From xen-changelog-bounces@lists.xensource.com Wed Aug 31 01:26:27 2011 Return-path: Envelope-to: www-data@lists.xensource.com Delivery-date: Wed, 31 Aug 2011 01:26:27 -0700 Received: from localhost ([127.0.0.1] helo=lists.colo.xensource.com) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg7v-0001jR-Hf; Wed, 31 Aug 2011 01:26:27 -0700 Received: from mail174.messagelabs.com ([85.158.138.51]) by lists.xensource.com with esmtp (Exim 4.43) id 1Qyg44-0000Hk-HX for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 01:22:28 -0700 X-Env-Sender: xen@xenbits.xen.org X-Msg-Ref: server-4.tower-174.messagelabs.com!1314778944!29724173!1 X-Originating-IP: [93.93.131.152] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31931 invoked from network); 31 Aug 2011 08:22:25 -0000 Received: from xenbits.xen.org (HELO xenbits.xen.org) (93.93.131.152) by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP; 31 Aug 2011 08:22:25 -0000 Received: from xen by xenbits.xen.org with local (Exim 4.72) (envelope-from ) id 1Qyg40-0000hd-OX for xen-changelog@lists.xensource.com; Wed, 31 Aug 2011 09:22:24 +0100 Message-Id: Date: Wed, 31 Aug 2011 09:22:24 +0100 From: Xen patchbot-4.1-testing To: xen-changelog@lists.xensource.com Subject: [Xen-changelog] [xen-4.1-testing] libxl: Do not SEGV when no 'removable' disk parameter in xenstore X-BeenThere: xen-changelog@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list Reply-To: xen-devel@lists.xensource.com List-Id: BK change log List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-changelog-bounces@lists.xensource.com Errors-To: xen-changelog-bounces@lists.xensource.com # HG changeset patch # User Marek Marczykowski # Date 1307285721 -7200 # Node ID be4b078e2d083be51f4ae7d73434750a6ba14915 # Parent e606d167fc00de40685c52618c33a54f7a445825 libxl: Do not SEGV when no 'removable' disk parameter in xenstore Just assume disk as not removable when no 'removable' paremeter Signed-off-by: Marek Marczykowski xen-unstable changest: 23607:2f63562df1c4 Backport-requested-by: Marek Marczykowski Committed-by: Ian Jackson --- diff -r e606d167fc00 -r be4b078e2d08 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Sun Jun 05 16:53:03 2011 +0200 +++ b/tools/libxl/libxl.c Sun Jun 05 16:55:21 2011 +0200 @@ -1724,6 +1724,7 @@ libxl__xs_get_dompath(&gc, 0), type, domid); dir = libxl__xs_directory(&gc, XBT_NULL, be_path, &n); if (dir) { + char *removable; *disks = realloc(*disks, sizeof (libxl_device_disk) * (*ndisks + n)); pdisk = *disks + *ndisks; *ndisks += n; @@ -1742,7 +1743,11 @@ libxl__sprintf(&gc, "%s/%s/type", be_path, *dir)), &(pdisk->backend)); pdisk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(&gc, "%s/%s/dev", be_path, *dir), &len); - pdisk->unpluggable = atoi(libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/%s/removable", be_path, *dir))); + removable = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/%s/removable", be_path, *dir)); + if (removable) + pdisk->unpluggable = atoi(removable); + else + pdisk->unpluggable = 0; if (!strcmp(libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/%s/mode", be_path, *dir)), "w")) pdisk->readwrite = 1; else _______________________________________________ Xen-changelog mailing list Xen-changelog@lists.xensource.com http://lists.xensource.com/xen-changelog