Derek Murray
2007-Mar-28 12:56 UTC
[Xen-devel] [PATCH 2/3] User-space grant table device - main driver
A character device for accessing (in user-space) pages that have been granted by other domains. Signed-off-by: Derek Murray <Derek.Murray@cl.cam.ac.uk> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Isaku Yamahata
2007-Mar-29 06:26 UTC
Re: [Xen-devel] [PATCH 2/3] User-space grant table device - main driver
On Wed, Mar 28, 2007 at 01:56:16PM +0100, Derek Murray wrote:> +static int gntdev_mmap (struct file *flip, struct vm_area_struct *vma) > +{...> + /* In this case, we simply insert the page into the VM > + * area. */ > + ret = vm_insert_page(vma, user_vaddr, page);...> +undo_map_out: > + > + /* If we have a mapping failure during the mmap, we rollback all > + * mappings. > + */ > + > + /* First undo the kernel mappings. */ > + for (i = 0; i < undo_count_kmaps; ++i) { > + struct gnttab_unmap_grant_ref unmap_op; > + gnttab_set_unmap_op(&unmap_op, > + get_kernel_vaddr(vma, slot_index + i), > + GNTMAP_host_map, > + private_data->grants[slot_index] > + .u.valid.kernel_handle); > + ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, > + &unmap_op, 1); > + BUG_ON(ret); > + > + printk("Kernel unmap status = %d\n", unmap_op.status); > + > + /* Return slot to the not-yet-mapped state, so that it may be > + * mapped again, or removed by a subsequent ioctl. > + */ > + private_data->grants[slot_index+i].state > + GNTDEV_SLOT_NOT_YET_MAPPED; > + > + /* Invalidate the physical to machine mapping for this page. */ > + set_phys_to_machine(__pa(get_kernel_vaddr(vma, slot_index)) > + >> PAGE_SHIFT, INVALID_P2M_ENTRY); > + }This doesn''t undo vm_insert_page() when auto trasnalted physmap mode. Probably just calling zap_page_range() would be OK instead of undo_count_kmap loop.> +static pte_t gntdev_clear_pte(struct vm_area_struct *vma, unsigned long addr, > + pte_t *ptep, int is_fullmm) > +{ > + int slot_index, ret; > + pte_t copy; > + struct gnttab_unmap_grant_ref op; > + gntdev_file_private_data_t *private_data > + = (gntdev_file_private_data_t *) vma->vm_file->private_data; > + > + /* Copy the existing value of the PTE for returning. */ > + copy = *ptep; > + > + /* Calculate the grant relating to this PTE. */ > + slot_index = vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT); > + > + /* First, we unmap the grant from kernel space. */ > + gnttab_set_unmap_op(&op, get_kernel_vaddr(vma, slot_index), > + GNTMAP_host_map, > + private_data->grants[slot_index].u.valid > + .kernel_handle); > + ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1); > + BUG_ON(ret); > + if (op.status) > + printk("Kernel unmap grant status = %d\n", op.status); > + > + /* Next, we clear the user space mapping. */ > + if (!xen_feature(XENFEAT_auto_translated_physmap)) { > + /* NOT USING SHADOW PAGE TABLES. */ > + gnttab_set_unmap_op(&op, virt_to_machine(ptep), > + GNTMAP_contains_pte, > + private_data->grants[slot_index].u.valid > + .user_handle); > + ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, > + &op, 1); > + if (op.status) > + printk("User unmap grant status = %d\n", op.status); > + BUG_ON(ret); > + } else { > + /* USING SHADOW PAGE TABLES. */ > + pte_clear_full(vma->vm_mm, addr, ptep, is_fullmm);Please clear the entry before grant table unmap. If the virtual address is accessed between grant tabel unmap and pte_clear_full(), something bad would happen. The higher level exclusion is done and I might be somewhat paranoia, though.> +/* Called when an ioctl is made on the device. > + */ > +static int gntdev_ioctl(struct inode *inode, struct file *flip, > + unsigned int cmd, unsigned long arg) > +{ > + int rc = 0; > + switch (cmd) { > + case IOCTL_GNTDEV_MAP_GRANT_REF: > + { > + struct ioctl_gntdev_map_grant_ref op; > + struct ioctl_gntdev_grant_ref ref; > + down_write(¤t->mm->mmap_sem); > + > + if ((rc = copy_from_user(&op, > + (void __user *) arg, > + sizeof(op)))) {copy_from/to_user() may result in page fault and page fault handler may try to obtain it causing dead lock. -- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Derek Murray
2007-Mar-29 09:23 UTC
Re: [Xen-devel] [PATCH 2/3] User-space grant table device - main driver
On 29 Mar 2007, at 07:26, Isaku Yamahata wrote:> On Wed, Mar 28, 2007 at 01:56:16PM +0100, Derek Murray wrote: > >> +static int gntdev_mmap (struct file *flip, struct vm_area_struct >> *vma) >> +{ > ... >> +undo_map_out: > > This doesn''t undo vm_insert_page() when auto trasnalted physmap mode. > Probably just calling zap_page_range() would be OK instead > of undo_count_kmap loop.Hmm, in fact, this whole section is redundant, because a failing gntdev_mmap() will be cleaned up in do_mmap_pgoff(), and, subsequently, the gntdev_clear_pte() hook will be called. This does a pte_clear_full() on the user-space PTE in auto translated physmap mode, so would this be enough?>> +static pte_t gntdev_clear_pte(struct vm_area_struct *vma, >> unsigned long addr, >> + pte_t *ptep, int is_fullmm) > > Please clear the entry before grant table unmap. > If the virtual address is accessed between grant tabel unmap and > pte_clear_full(), something bad would happen. > The higher level exclusion is done and I might be somewhat > paranoia, though.Better safe than sorry! I''ll fix this.>> +static int gntdev_ioctl(struct inode *inode, struct file *flip, >> + unsigned int cmd, unsigned long arg) > > copy_from/to_user() may result in page fault and page fault handler > may try to obtain it causing dead lock.Ah, good point. I''ll move these copies out of the critical section. Thanks for your comments! Regards, Derek Murray. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 10:31:48 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 10:31:48 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWqyy-00051b-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 10:31:48 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:46318 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HWqxX-0001Ta-2G (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 10:30:24 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWqyH-0007PS-1Z; Thu, 29 Mar 2007 09:31:05 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWqxx-00076E-Uo for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 09:30:45 +0000 Received: from mga01.intel.com ([192.55.52.88]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWqxv-0006Pi-Ax for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 09:30:43 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by mga01.intel.com with ESMTP; 29 Mar 2007 02:29:30 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by fmsmga001.fm.intel.com with ESMTP; 29 Mar 2007 02:29:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,345,1170662400"; d="scan''208"; a="221361545:sNHT21479717" Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 02:29:29 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Mar 2007 17:29:25 +0800 Message-ID: <B30DA1341B0CFA4893EF8A36B40B5C5DF22415@pdsmsx411.ccr.corp.intel.com> In-Reply-To: <C231416E.C779%keir@xensource.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] [PATCH] Proper use of VMX execution controls MSR. Thread-Index: AcdxUQOcmZ2ehsIdTvOT1iiVu1vOEgAEiiMSAA+9sZAADN/eOAAAdMgwAAK1/kQAAJdmQA=From: "Li, Xin B" <xin.b.li@intel.com> To: "Keir Fraser" <keir@xensource.com>, <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 29 Mar 2007 09:29:29.0779 (UTC) FILETIME=[C066C030:01C771E4] X-SA-Exim-Connect-IP: 192.55.52.88 X-SA-Exim-Mail-From: xin.b.li@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] [PATCH] Proper use of VMX execution controls MSR. X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com>The subsequent AND with msr_hi and the OR with msr_lo has exactly thesame>effect. So the AND (msr_hi XOR msr_lo) is not incorrect, but it isredundant.>Seems correct :-). -Xin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 10:36:22 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 10:36:22 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWr3O-0001nR-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 10:36:22 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:48552 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HWr34-0000GS-9x (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 10:36:07 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWr3l-0007r7-Vk; Thu, 29 Mar 2007 09:36:46 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWr3S-0007ZD-V6 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 09:36:26 +0000 Received: from fms-01.valinux.co.jp ([210.128.90.1] helo=mail.valinux.co.jp) by lists.xensource.com with esmtp (Exim 4.50) id 1HWr3Q-0006Qu-4Y for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 09:36:24 +0000 Received: from ls (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 185DF2DC788; Thu, 29 Mar 2007 18:35:02 +0900 (JST) Received: (nullmailer pid 12920 invoked by uid 20675); Thu, 29 Mar 2007 09:35:02 -0000 Date: Thu, 29 Mar 2007 18:35:02 +0900 From: Isaku Yamahata <yamahata@valinux.co.jp> To: Derek Murray <Derek.Murray@cl.cam.ac.uk> Message-ID: <20070329093502.GD3737%yamahata@valinux.co.jp> References: <68F773A4-30BF-49BE-A3CB-8551D223AC0F@cl.cam.ac.uk> <20070329062651.GB3737%yamahata@valinux.co.jp> <B9EAEF16-671E-47A8-B93F-40F129CBCFAE@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <B9EAEF16-671E-47A8-B93F-40F129CBCFAE@cl.cam.ac.uk> User-Agent: Mutt/1.4.2.1i X-SA-Exim-Connect-IP: 210.128.90.1 X-SA-Exim-Mail-From: yamahata@valinux.co.jp X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] [PATCH 2/3] User-space grant table device - main driver X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Thu, Mar 29, 2007 at 10:23:05AM +0100, Derek Murray wrote:> On 29 Mar 2007, at 07:26, Isaku Yamahata wrote: > >On Wed, Mar 28, 2007 at 01:56:16PM +0100, Derek Murray wrote: > > > >>+static int gntdev_mmap (struct file *flip, struct vm_area_struct > >>*vma) > >>+{ > >... > >>+undo_map_out: > > > >This doesn''t undo vm_insert_page() when auto trasnalted physmap mode. > >Probably just calling zap_page_range() would be OK instead > >of undo_count_kmap loop. > > Hmm, in fact, this whole section is redundant, because a failing > gntdev_mmap() will be cleaned up in do_mmap_pgoff(), and, > subsequently, the gntdev_clear_pte() hook will be called. This does a > pte_clear_full() on the user-space PTE in auto translated physmap > mode, so would this be enough?Yes. Understood. -- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 12:56:39 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 12:56:39 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWtF8-0004TD-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 12:56:38 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:57431 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HWtDf-00031A-0x (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 12:55:12 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWtEP-0001Pg-PA; Thu, 29 Mar 2007 11:55:53 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWtE4-00017t-FD for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 11:55:32 +0000 Received: from nz-out-0506.google.com ([64.233.162.238]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWtE1-0007H2-T2 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 11:55:30 +0000 Received: by nz-out-0506.google.com with SMTP id f1so113996nzc for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 04:54:19 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=p24xky4qbLBLnfXHSz+Ji5YVwFp3K6cfqbVQ+8Op0LmevzwsmSkzN1yr+sVdje+ohIacXc9j/gMLlI44WQ46VMYPjxYZCYrzw9pbeOoIBHHS/8qwkIMKdhZaa43xqC95aLC26E30nulZHypB+/usbRomvOMvntbZMt83f5lmUF8DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NBJOdQ2jQDwDMb4FAOtLyY/3wRqaGsvJK4tYMtutLz3w8ptML+2CXkbUpsjchpFgf/aoROB/meJtud/r8Pu7qeqsWuPofYlBGtEEHI8eG1PJLB5Nk79vtdL5dKoKI7cD8zIrOq8lZBl3/NQ9eT8UjrLXf4nZuflgdDxLyAICka4Received: by 10.114.161.11 with SMTP id j11mr211857wae.1175169258696; Thu, 29 Mar 2007 04:54:18 -0700 (PDT) Received: by 10.114.199.2 with HTTP; Thu, 29 Mar 2007 04:54:18 -0700 (PDT) Message-ID: <280848580703290454o407cf95amdad3741d7bf358e@mail.gmail.com> Date: Thu, 29 Mar 2007 13:54:18 +0200 From: "David Pilger" <pilger.david@gmail.com> To: xen-devel@lists.xensource.com MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-SA-Exim-Connect-IP: 64.233.162.238 X-SA-Exim-Mail-From: pilger.david@gmail.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Kernel module compilation X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Hello all, How can I build just a single kernel module from the linux-xen sources. for instance, compile just the xen kernel modules directory... Thanks, David. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 13:54:09 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 13:54:09 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWu8m-0000FB-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 13:54:08 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:40160 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HWu80-00046M-N3 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 13:53:25 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWu8k-0004iE-LX; Thu, 29 Mar 2007 12:54:06 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWu8Q-0004PJ-Nx for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 12:53:46 +0000 Received: from rgminet01.oracle.com ([148.87.113.118]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWu8M-0007Yi-6q for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 12:53:44 +0000 Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.186.112]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l2TCqQuB016796 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 06:52:26 -0600 Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw3.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l2TBL36l012943 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 06:52:25 -0600 Received: from dhcp-bangalore-lexington-towers-v413-10-177-251-90.idc.oracle.com by acsmt350.oracle.com with ESMTP id 2572443131175172725; Thu, 29 Mar 2007 05:52:05 -0700 Message-ID: <460BB681.6070503@oracle.com> Date: Thu, 29 Mar 2007 18:22:17 +0530 From: Premjith Rayaroth <premjith.rayaroth@oracle.com> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: xen-devel@lists.xensource.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAIX-SA-Exim-Connect-IP: 148.87.113.118 X-SA-Exim-Mail-From: premjith.rayaroth@oracle.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Java support for Xen APIs X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Hi, Is Java support available for Xen APIs. Can I use Java to make XML-RPC calls to the Xen machines? I assume only ''C'' and ''Python'' are supported. Is there any plan to support Java. Thanks -Prem _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 13:59:58 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 13:59:58 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWuEP-0005aF-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 13:59:57 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:47909 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWuE6-00073u-7m (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 13:59:43 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWuEo-00055I-NK; Thu, 29 Mar 2007 13:00:22 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWuER-0004nW-Qi for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 12:59:59 +0000 Received: from mu-out-0910.google.com ([209.85.134.186]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWuEP-0007ib-7D for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 12:59:57 +0000 Received: by mu-out-0910.google.com with SMTP id w1so173532mue for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 05:58:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KwzHzmS7IN4KfpCTeArA7bayg1GK+rKiQ0n3ngyPrCntpUhP0QLn1+q7sFWI7T1kbZ1EEvF/HuscB+0YrpfmM4FJ/kgD+DXGP4SPfDwDV+n+biQDOAFOFoYFZUz8n33k+ToU0xxrENCBR93R8v1JYDmxMVTMmujbjTjKbDNB+usDomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hlUhd9svEyMdSyqtw4lWsfu2RYBUbyHHNgkRs5w+6q8FvGtR2+TPOhJhtT2ZDeJcKs0gtktpkLxoUsyi8GsGFpmFMNMGt8im1nDgccNfLFWl/NKNW0LOw61URA0QuzZCV9NCmH+ejVJOxw3zJMxcyg4n5/nYO7bu9FDFvMgn1PQReceived: by 10.82.178.11 with SMTP id a11mr1426225buf.1175173128072; Thu, 29 Mar 2007 05:58:48 -0700 (PDT) Received: by 10.82.180.7 with HTTP; Thu, 29 Mar 2007 05:58:48 -0700 (PDT) Message-ID: <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> Date: Thu, 29 Mar 2007 08:58:48 -0400 From: "Ray Kelm" <kelmray@gmail.com> To: "Premjith Rayaroth" <premjith.rayaroth@oracle.com> In-Reply-To: <460BB681.6070503@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <460BB681.6070503@oracle.com> X-SA-Exim-Connect-IP: 209.85.134.186 X-SA-Exim-Mail-From: kelmray@gmail.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Java support for Xen APIs X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com I''ve had some success using the apache xml-rpc library to access xen with version 3.0.4. There were a few gotchas, such as having to enable extension support because xend was sending back nil as a result, which is only valid if extensions are enabled. Unfortunately, it appears that xend was not honoring the fact that extension support is negotiated. It would be handy to have a packaged solution that exports a simple api for talking to xend, as building some of the control structures is a bit of a pain. -Ray On 3/29/07, Premjith Rayaroth <premjith.rayaroth@oracle.com> wrote:> Hi, > > Is Java support available for Xen APIs. Can I use Java to make XML-RPC > calls to the Xen machines? I assume only ''C'' and ''Python'' are supported. > Is there any plan to support Java. > > Thanks > -Prem > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 14:15:25 2007 Return-path: <stefanb@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 14:15:25 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWuTN-0005tj-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 14:15:25 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from igw2.watson.ibm.com ([129.34.20.6]:60259) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HWuSf-0003pm-3A (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <stefanb@us.ibm.com>); Thu, 29 Mar 2007 14:14:42 +0100 Received: from mailhub4.watson.ibm.com (mailhub4.watson.ibm.com [129.34.20.46]) by igw2.watson.ibm.com (8.13.1/8.13.1/8.13.1-2005-04-25 igw) with ESMTP id l2TDFxiE014197; Thu, 29 Mar 2007 09:15:59 -0400 Received: from mailhub4.watson.ibm.com (localhost.localdomain [127.0.0.1]) by mailhub4.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-Delivery) with ESMTP id l2TDEc0j011295; Thu, 29 Mar 2007 09:14:38 -0400 Received: from 941e-2.watson.ibm.com (941e-2.watson.ibm.com [9.2.15.131]) by mailhub4.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-IMSS) with ESMTP id l2TDEbjB011292; Thu, 29 Mar 2007 09:14:37 -0400 Subject: [PATCH] [XEN] [ACM] Allow choosing the VM label of dom0 in kernel line in grub.conf From: Stefan Berger <stefanb@us.ibm.com> To: xen-devel <xen-devel@lists.xensource.com> Cc: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Content-Type: multipart/mixed; boundary="=-6xpWz18T6deg1ugao2MZ" Date: Thu, 29 Mar 2007 09:19:25 -0400 Message-Id: <1175174365.3102.3.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) --=-6xpWz18T6deg1ugao2MZ Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch provides the possibility to choose the VM label of domain-0 in the kernel line in grub.conf. The format is ssidref=<ssid ref>:sHype:<policy name>:<vm label>. The name of the policy specified here must be the same name as the in the policy provided as a module during boot, otherwise the policy will not be accepted and the system then starts without a policy. The user tool for ''xm dumppolicy'' has been adapted to show which entry in the binary policy is used by domain-0. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> --=-6xpWz18T6deg1ugao2MZ Content-Disposition: attachment; filename=acm_ssidref_grub.diff Content-Type: text/x-patch; name=acm_ssidref_grub.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit --- xen-unstable.hg/tools/security/secpol_tool.c | 59 +++++++++- xen-unstable.hg/tools/security/secpol_xml2bin.c | 3 xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c | 13 ++ xen-unstable.hg/xen/acm/acm_core.c | 65 ++++++++++-- xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c | 26 +++- xen-unstable.hg/xen/include/acm/acm_core.h | 9 + xen-unstable.hg/xen/include/acm/acm_hooks.h | 12 +- 7 files changed, 156 insertions(+), 31 deletions(-) Index: root/xen-unstable.hg/xen/acm/acm_core.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_core.c +++ root/xen-unstable.hg/xen/acm/acm_core.c @@ -62,18 +62,63 @@ struct acm_binary_policy acm_bin_pol; /* acm binary policy lock */ DEFINE_RWLOCK(acm_bin_pol_rwlock); +/* ACM''s only accepted policy name */ +char polname[80]; +char *acm_accepted_boot_policy_name = NULL; + +static void __init set_dom0_ssidref(const char *val) +{ + /* expected format: + ssidref=<hex number>:<policy name> + Policy name must not have a ''space''. + */ + const char *c; + int lo, hi; + int i; + int dom0_ssidref = simple_strtoull(val, &c, 0); + + if (!strncmp(&c[0],":sHype:", 7)) { + lo = dom0_ssidref & 0xffff; + if (lo < ACM_MAX_NUM_TYPES && lo >= 1) + dom0_chwall_ssidref = lo; + hi = dom0_ssidref >> 16; + if (hi < ACM_MAX_NUM_TYPES && hi >= 1) + dom0_ste_ssidref = hi; + for (i = 0; i < sizeof(polname); i++) { + polname[i] = c[7+i]; + if (polname[i] == ''\0'' || polname[i] == ''\t'' || + polname[i] == ''\n'' || polname[i] == '' '' || + polname[i] == '':'') { + break; + } + } + polname[i] = 0; + acm_accepted_boot_policy_name = polname; + } +} + +custom_param("ssidref", set_dom0_ssidref); + int acm_set_policy_reference(u8 *buf, u32 buf_size) { + char *name = (char *)(buf + sizeof(struct acm_policy_reference_buffer)); struct acm_policy_reference_buffer *pr = (struct acm_policy_reference_buffer *)buf; + + if (acm_accepted_boot_policy_name != NULL) { + if (strcmp(acm_accepted_boot_policy_name, name)) { + printk("Policy''s name ''%s'' is not the expected one ''%s''.\n", + name, acm_accepted_boot_policy_name); + return ACM_ERROR; + } + } + acm_bin_pol.policy_reference_name = (char *)xmalloc_array(u8, be32_to_cpu(pr->len)); if (!acm_bin_pol.policy_reference_name) return -ENOMEM; + strlcpy(acm_bin_pol.policy_reference_name, name, be32_to_cpu(pr->len)); - strlcpy(acm_bin_pol.policy_reference_name, - (char *)(buf + sizeof(struct acm_policy_reference_buffer)), - be32_to_cpu(pr->len)); printk("%s: Activating policy %s\n", __func__, acm_bin_pol.policy_reference_name); return 0; @@ -190,7 +235,8 @@ acm_is_policy(char *buf, unsigned long l static int acm_setup(char *policy_start, - unsigned long policy_len) + unsigned long policy_len, + int is_bootpolicy) { int rc = ACM_OK; struct acm_policy_buffer *pol; @@ -202,7 +248,8 @@ acm_setup(char *policy_start, if (be32_to_cpu(pol->magic) != ACM_MAGIC) return rc; - rc = do_acm_set_policy((void *)policy_start, (u32)policy_len); + rc = do_acm_set_policy((void *)policy_start, (u32)policy_len, + is_bootpolicy); if (rc == ACM_OK) { printkd("Policy len 0x%lx, start at %p.\n",policy_len,policy_start); @@ -224,7 +271,10 @@ acm_init(char *policy_start, int ret = ACM_OK; /* first try to load the boot policy (uses its own locks) */ - acm_setup(policy_start, policy_len); + acm_setup(policy_start, policy_len, 1); + + /* a user-provided policy may have any name; only matched during boot */ + acm_accepted_boot_policy_name = NULL; if (acm_active_security_policy != ACM_POLICY_UNDEFINED) { @@ -236,6 +286,9 @@ acm_init(char *policy_start, printk("%s: Loading default policy (%s).\n", __func__, ACM_POLICY_NAME(ACM_DEFAULT_SECURITY_POLICY)); + /* (re-)set dom-0 ssidref to default */ + dom0_ste_ssidref = dom0_chwall_ssidref = 0x0001; + if (acm_init_binary_policy(ACM_DEFAULT_SECURITY_POLICY)) { ret = -EINVAL; goto out; Index: root/xen-unstable.hg/xen/include/acm/acm_hooks.h ==================================================================--- root.orig/xen-unstable.hg/xen/include/acm/acm_hooks.h +++ root/xen-unstable.hg/xen/include/acm/acm_hooks.h @@ -91,7 +91,8 @@ struct acm_operations { int (*init_domain_ssid) (void **ssid, ssidref_t ssidref); void (*free_domain_ssid) (void *ssid); int (*dump_binary_policy) (u8 *buffer, u32 buf_size); - int (*set_binary_policy) (u8 *buffer, u32 buf_size); + int (*set_binary_policy) (u8 *buffer, u32 buf_size, + int is_bootpolicy); int (*dump_statistics) (u8 *buffer, u16 buf_size); int (*dump_ssid_types) (ssidref_t ssidref, u8 *buffer, u16 buf_size); /* domain management control hooks (can be NULL) */ @@ -347,14 +348,13 @@ static inline int acm_pre_grant_setup(do } } -/* predefined ssidref for DOM0 used by xen when creating DOM0 */ -#define ACM_DOM0_SSIDREF 0x00010001 - static inline void acm_post_domain0_create(domid_t domid) { /* initialialize shared sHype security labels for new domain */ - acm_init_domain_ssid(domid, ACM_DOM0_SSIDREF); - acm_post_domain_create(domid, ACM_DOM0_SSIDREF); + int dom0_ssidref = dom0_ste_ssidref << 16 | dom0_chwall_ssidref; + + acm_init_domain_ssid(domid, dom0_ssidref); + acm_post_domain_create(domid, dom0_ssidref); } static inline int acm_sharing(ssidref_t ssidref1, ssidref_t ssidref2) Index: root/xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c +++ root/xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c @@ -31,6 +31,9 @@ #include <acm/acm_hooks.h> #include <asm/atomic.h> #include <acm/acm_endian.h> +#include <acm/acm_core.h> + +ssidref_t dom0_ste_ssidref = 0x0001; /* local cache structures for STE policy */ struct ste_binary_policy ste_bin_pol; @@ -74,15 +77,21 @@ int acm_init_ste_policy(void) { /* minimal startup policy; policy write-locked already */ ste_bin_pol.max_types = 1; - ste_bin_pol.max_ssidrefs = 2; - ste_bin_pol.ssidrefs = (domaintype_t *)xmalloc_array(domaintype_t, 2); - memset(ste_bin_pol.ssidrefs, 0, 2); + ste_bin_pol.max_ssidrefs = 1 + dom0_ste_ssidref; + ste_bin_pol.ssidrefs + (domaintype_t *)xmalloc_array(domaintype_t, + ste_bin_pol.max_types * + ste_bin_pol.max_ssidrefs); if (ste_bin_pol.ssidrefs == NULL) return ACM_INIT_SSID_ERROR; - /* initialize state so that dom0 can start up and communicate with itself */ - ste_bin_pol.ssidrefs[1] = 1; + memset(ste_bin_pol.ssidrefs, 0, sizeof(domaintype_t) * + ste_bin_pol.max_types * + ste_bin_pol.max_ssidrefs); + + /* initialize state so that dom0 can start up and communicate with itself */ + ste_bin_pol.ssidrefs[ste_bin_pol.max_types * dom0_ste_ssidref] = 1; /* init stats */ atomic_set(&(ste_bin_pol.ec_eval_count), 0); @@ -274,7 +283,7 @@ ste_init_state(struct acm_ste_policy_buf /* set new policy; policy write-locked already */ static int -ste_set_policy(u8 *buf, u32 buf_size) +ste_set_policy(u8 *buf, u32 buf_size, int is_bootpolicy) { struct acm_ste_policy_buffer *ste_buf = (struct acm_ste_policy_buffer *)buf; void *ssidrefsbuf; @@ -305,6 +314,11 @@ ste_set_policy(u8 *buf, u32 buf_size) if (ste_buf->ste_ssid_offset + sizeof(domaintype_t) * ste_buf->ste_max_ssidrefs*ste_buf->ste_max_types > buf_size) goto error_free; + /* during boot dom0_chwall_ssidref is set */ + if (is_bootpolicy && (dom0_ste_ssidref >= ste_buf->ste_max_ssidrefs)) { + goto error_free; + } + arrcpy(ssidrefsbuf, buf + ste_buf->ste_ssid_offset, sizeof(domaintype_t), Index: root/xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c +++ root/xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c @@ -41,6 +41,9 @@ #include <acm/acm_core.h> #include <acm/acm_hooks.h> #include <acm/acm_endian.h> +#include <acm/acm_core.h> + +ssidref_t dom0_chwall_ssidref = 0x0001; /* local cache structures for chinese wall policy */ struct chwall_binary_policy chwall_bin_pol; @@ -53,7 +56,7 @@ int acm_init_chwall_policy(void) { /* minimal startup policy; policy write-locked already */ chwall_bin_pol.max_types = 1; - chwall_bin_pol.max_ssidrefs = 2; + chwall_bin_pol.max_ssidrefs = 1 + dom0_chwall_ssidref; chwall_bin_pol.max_conflictsets = 1; chwall_bin_pol.ssidrefs (domaintype_t *) xmalloc_array(domaintype_t, @@ -254,7 +257,7 @@ chwall_init_state(struct acm_chwall_poli * more than one type is currently running */ } -static int chwall_set_policy(u8 * buf, u32 buf_size) +static int chwall_set_policy(u8 * buf, u32 buf_size, int is_bootpolicy) { /* policy write-locked already */ struct acm_chwall_policy_buffer *chwall_buf @@ -286,6 +289,12 @@ static int chwall_set_policy(u8 * buf, u (chwall_buf->policy_version != ACM_CHWALL_VERSION)) return -EINVAL; + /* during boot dom0_chwall_ssidref is set */ + if (is_bootpolicy && + (dom0_chwall_ssidref >= chwall_buf->chwall_max_ssidrefs)) { + goto error_free; + } + /* 1. allocate new buffers */ ssids xmalloc_array(domaintype_t, Index: root/xen-unstable.hg/tools/security/secpol_tool.c ==================================================================--- root.orig/xen-unstable.hg/tools/security/secpol_tool.c +++ root/xen-unstable.hg/tools/security/secpol_tool.c @@ -57,7 +57,7 @@ void usage(char *progname) /*************************** DUMPS *******************************/ -void acm_dump_chinesewall_buffer(void *buf, int buflen) +void acm_dump_chinesewall_buffer(void *buf, int buflen, uint16_t chwall_ref) { struct acm_chwall_policy_buffer *cwbuf @@ -91,6 +91,8 @@ void acm_dump_chinesewall_buffer(void *b for (j = 0; j < ntohl(cwbuf->chwall_max_types); j++) printf("%02x ", ntohs(ssids[i * ntohl(cwbuf->chwall_max_types) + j])); + if (i == chwall_ref) + printf(" <-- Domain-0"); } printf("\n\nConfict Sets:\n"); conflicts @@ -131,7 +133,7 @@ void acm_dump_chinesewall_buffer(void *b } } -void acm_dump_ste_buffer(void *buf, int buflen) +void acm_dump_ste_buffer(void *buf, int buflen, uint16_t ste_ref) { struct acm_ste_policy_buffer *stebuf @@ -158,11 +160,14 @@ void acm_dump_ste_buffer(void *buf, int for (j = 0; j < ntohl(stebuf->ste_max_types); j++) printf("%02x ", ntohs(ssids[i * ntohl(stebuf->ste_max_types) + j])); + if (i == ste_ref) + printf(" <-- Domain-0"); } printf("\n\n"); } -void acm_dump_policy_buffer(void *buf, int buflen) +void acm_dump_policy_buffer(void *buf, int buflen, + uint16_t chwall_ref, uint16_t ste_ref) { struct acm_policy_buffer *pol = (struct acm_policy_buffer *) buf; char *policy_reference_name @@ -190,13 +195,15 @@ void acm_dump_policy_buffer(void *buf, i acm_dump_chinesewall_buffer(ALIGN8(buf + ntohl(pol->primary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->primary_buffer_offset)); + ntohl(pol->primary_buffer_offset), + chwall_ref); break; case ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY: acm_dump_ste_buffer(ALIGN8(buf + ntohl(pol->primary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->primary_buffer_offset)); + ntohl(pol->primary_buffer_offset), + ste_ref); break; case ACM_NULL_POLICY: @@ -212,13 +219,15 @@ void acm_dump_policy_buffer(void *buf, i acm_dump_chinesewall_buffer(ALIGN8(buf + ntohl(pol->secondary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->secondary_buffer_offset)); + ntohl(pol->secondary_buffer_offset), + chwall_ref); break; case ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY: acm_dump_ste_buffer(ALIGN8(buf + ntohl(pol->secondary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->secondary_buffer_offset)); + ntohl(pol->secondary_buffer_offset), + ste_ref); break; case ACM_NULL_POLICY: @@ -230,6 +239,27 @@ void acm_dump_policy_buffer(void *buf, i } } +/************************** get dom0 ssidref *****************************/ +int acm_get_ssidref(int xc_handle, int domid, uint16_t *chwall_ref, + uint16_t *ste_ref) +{ + int ret; + struct acm_getssid getssid; + char buf[4096]; + struct acm_ssid_buffer *ssid = (struct acm_ssid_buffer *)buf; + getssid.interface_version = ACM_INTERFACE_VERSION; + set_xen_guest_handle(getssid.ssidbuf, buf); + getssid.ssidbuf_size = sizeof(buf); + getssid.get_ssid_by = ACM_GETBY_domainid; + getssid.id.domainid = domid; + ret = xc_acm_op(xc_handle, ACMOP_getssid, &getssid, sizeof(getssid)); + if (ret == 0) { + *chwall_ref = ssid->ssidref & 0xffff; + *ste_ref = ssid->ssidref >> 16; + } + return ret; +} + /******************************* get policy ******************************/ #define PULL_CACHE_SIZE 8192 @@ -239,12 +269,16 @@ int acm_domain_getpolicy(int xc_handle) { struct acm_getpolicy getpolicy; int ret; + uint16_t chwall_ref, ste_ref; memset(pull_buffer, 0x00, sizeof(pull_buffer)); getpolicy.interface_version = ACM_INTERFACE_VERSION; set_xen_guest_handle(getpolicy.pullcache, pull_buffer); getpolicy.pullcache_size = sizeof(pull_buffer); ret = xc_acm_op(xc_handle, ACMOP_getpolicy, &getpolicy, sizeof(getpolicy)); + if (ret >= 0) { + ret = acm_get_ssidref(xc_handle, 0, &chwall_ref, &ste_ref); + } if (ret < 0) { printf("ACM operation failed: errno=%d\n", errno); @@ -254,7 +288,9 @@ int acm_domain_getpolicy(int xc_handle) } /* dump policy */ - acm_dump_policy_buffer(pull_buffer, sizeof(pull_buffer)); + acm_dump_policy_buffer(pull_buffer, sizeof(pull_buffer), + chwall_ref, ste_ref); + return ret; } @@ -266,6 +302,7 @@ int acm_domain_loadpolicy(int xc_handle, int ret, fd; off_t len; uint8_t *buffer; + uint16_t chwall_ssidref, ste_ssidref; if ((ret = stat(filename, &mystat))) { printf("File %s not found.\n", filename); @@ -282,10 +319,14 @@ int acm_domain_loadpolicy(int xc_handle, printf("File %s not found.\n", filename); goto free_out; } + ret =acm_get_ssidref(xc_handle, 0, &chwall_ssidref, &ste_ssidref); + if (ret < 0) { + goto free_out; + } if (len == read(fd, buffer, len)) { struct acm_setpolicy setpolicy; /* dump it and then push it down into xen/acm */ - acm_dump_policy_buffer(buffer, len); + acm_dump_policy_buffer(buffer, len, chwall_ssidref, ste_ssidref); setpolicy.interface_version = ACM_INTERFACE_VERSION; set_xen_guest_handle(setpolicy.pushcache, buffer); setpolicy.pushcache_size = len; Index: root/xen-unstable.hg/tools/security/secpol_xml2bin.c ==================================================================--- root.orig/xen-unstable.hg/tools/security/secpol_xml2bin.c +++ root/xen-unstable.hg/tools/security/secpol_xml2bin.c @@ -1163,7 +1163,8 @@ int write_binary(char *filename) u_int32_t len_ste = 0, len_chwall = 0, len_pr = 0; /* length of policy components */ - sscanf(policy_version_string,"%d.%d", &major, &minor); + if (policy_version_string) + sscanf(policy_version_string,"%d.%d", &major, &minor); /* open binary file */ if ((fd Index: root/xen-unstable.hg/xen/include/acm/acm_core.h ==================================================================--- root.orig/xen-unstable.hg/xen/include/acm/acm_core.h +++ root/xen-unstable.hg/xen/include/acm/acm_core.h @@ -123,13 +123,20 @@ int acm_init_domain_ssid(domid_t id, ssi void acm_free_domain_ssid(struct acm_ssid_domain *ssid); int acm_init_binary_policy(u32 policy_code); int acm_set_policy(XEN_GUEST_HANDLE(void) buf, u32 buf_size); -int do_acm_set_policy(void *buf, u32 buf_size); +int do_acm_set_policy(void *buf, u32 buf_size, int is_bootpolicy); int acm_get_policy(XEN_GUEST_HANDLE(void) buf, u32 buf_size); int acm_dump_statistics(XEN_GUEST_HANDLE(void) buf, u16 buf_size); int acm_get_ssid(ssidref_t ssidref, XEN_GUEST_HANDLE(void) buf, u16 buf_size); int acm_get_decision(ssidref_t ssidref1, ssidref_t ssidref2, u32 hook); int acm_set_policy_reference(u8 * buf, u32 buf_size); int acm_dump_policy_reference(u8 *buf, u32 buf_size); + + +/* variables */ +extern ssidref_t dom0_chwall_ssidref; +extern ssidref_t dom0_ste_ssidref; +#define ACM_MAX_NUM_TYPES (256) + #endif /* --=-6xpWz18T6deg1ugao2MZ-- From xen-devel-bounces.xensource.com Thu Mar 29 14:26:24 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 14:26:24 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWue0-0000m4-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 14:26:24 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:50688 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HWucu-0007Vq-Ch (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 14:25:21 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWudf-0006V7-Pi; Thu, 29 Mar 2007 13:26:03 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWudH-0006Ct-Sv for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:25:39 +0000 Received: from 207.47.60.150.static.nextweb.net ([207.47.60.150] helo=webmail.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWudF-0007u2-7I for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:25:37 +0000 Received: from leeni.uk.xensource.com ([172.31.0.52]) by webmail.xensource.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 05:24:26 -0800 Received: from emellor by leeni.uk.xensource.com with local (Exim 4.50) id 1HWuc5-0006LI-Bs; Thu, 29 Mar 2007 14:24:25 +0100 Date: Thu, 29 Mar 2007 14:24:25 +0100 From: Ewan Mellor <ewan@xensource.com> To: Premjith Rayaroth <premjith.rayaroth@oracle.com> Message-ID: <20070329132425.GJ16195@leeni.uk.xensource.com> References: <460BB681.6070503@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <460BB681.6070503@oracle.com> User-Agent: Mutt/1.5.9i X-OriginalArrivalTime: 29 Mar 2007 13:24:26.0541 (UTC) FILETIME=[92B9EDD0:01C77205] X-SA-Exim-Connect-IP: 207.47.60.150 X-SA-Exim-Mail-From: ewan@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Java support for Xen APIs X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Thu, Mar 29, 2007 at 06:22:17PM +0530, Premjith Rayaroth wrote:> Hi, > > Is Java support available for Xen APIs. Can I use Java to make XML-RPC > calls to the Xen machines? I assume only ''C'' and ''Python'' are supported. > Is there any plan to support Java.It''s something we''ve thought about, but it''s not got further than that. If this was something that enough people were interested in, maybe we could commit some time to make it happen. Vote now! On the subject of language bindings, Ingard Mevg has had a lot of success using RPC::XML::Client in Perl (he''ll be open-sourcing an example script very soon). Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 14:26:52 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 14:26:52 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWueS-0006Br-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 14:26:52 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:56664 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWue9-0002L9-9K (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 14:26:38 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWuet-0006xS-Gf; Thu, 29 Mar 2007 13:27:19 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWueW-0006ez-HQ for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:26:56 +0000 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWueT-0007ud-9g for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:26:54 +0000 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id l2TDPbC5023532 for <xen-devel@lists.xensource.com> (envelope-from nishi.hidetoshi@jp.fujitsu.com); Thu, 29 Mar 2007 22:25:37 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id EA01A2AC027 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 22:25:36 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id C2CAC12C0A4 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 22:25:36 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2 [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id A7603181802B for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 22:25:36 +0900 (JST) Received: from ml2.s.css.fujitsu.com (ml2.s.css.fujitsu.com [10.23.4.192]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 2D8DC1818028 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 22:25:36 +0900 (JST) Received: from ml2.css.fujitsu.com (ml2 [127.0.0.1]) by ml2.s.css.fujitsu.com (Postfix) with ESMTP id 15117990039 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 22:25:36 +0900 (JST) Received: from jp.fujitsu.com (dhcp178-229.sky.yk.fujitsu.co.jp [10.34.178.229]) by ml2.s.css.fujitsu.com (Postfix) with SMTP id C086F990023 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 22:25:35 +0900 (JST) From: Hidetoshi Nishi <nishi.hidetoshi@jp.fujitsu.com> To: xen-devel@lists.xensource.com Date: Thu, 29 Mar 2007 22:24:02 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: TuruKame 3.56 (WinNT,501) Message-Id: <E7C77205849538nishi.hidetoshi@jp.fujitsu.com> X-SA-Exim-Connect-IP: 192.51.44.36 X-SA-Exim-Mail-From: nishi.hidetoshi@jp.fujitsu.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Media written by multi-session are not read all data. X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Hi all. I have the following trouble. I attached CD-ROM drive to guest domain and read CD-RW media. The CD-RW media had 8 folders but I could read 5 folders only. The CD-RW media was written by multi-session and I could read first session''s data. Second session''s data were not able to read. I tried CD-R media also, it was once written without finalize and later I wrote second data additionaly. Same problem happend. So the media which were written by multi-session were read first session''s data only regardless of CD-R and CD-RW. Thank you. Nishi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 14:28:36 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 14:28:36 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWug8-0006F5-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 14:28:36 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:44924 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HWuf7-0002O8-OD (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 14:27:38 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWufr-0007KV-7M; Thu, 29 Mar 2007 13:28:19 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWufU-00071n-GI for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:27:56 +0000 Received: from 207.47.60.150.static.nextweb.net ([207.47.60.150] helo=webmail.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWufN-0007vA-N3 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:27:54 +0000 Received: from leeni.uk.xensource.com ([172.31.0.52]) by webmail.xensource.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 05:26:38 -0800 Received: from emellor by leeni.uk.xensource.com with local (Exim 4.50) id 1HWueE-0006Lv-5R; Thu, 29 Mar 2007 14:26:38 +0100 Date: Thu, 29 Mar 2007 14:26:38 +0100 From: Ewan Mellor <ewan@xensource.com> To: Ray Kelm <kelmray@gmail.com> Message-ID: <20070329132638.GK16195@leeni.uk.xensource.com> References: <460BB681.6070503@oracle.com> <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> User-Agent: Mutt/1.5.9i X-OriginalArrivalTime: 29 Mar 2007 13:26:39.0175 (UTC) FILETIME=[E1C84570:01C77205] X-SA-Exim-Connect-IP: 207.47.60.150 X-SA-Exim-Mail-From: ewan@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Java support for Xen APIs X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Premjith Rayaroth <premjith.rayaroth@oracle.com>, xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Thu, Mar 29, 2007 at 08:58:48AM -0400, Ray Kelm wrote:> I''ve had some success using the apache xml-rpc library to access xen > with version 3.0.4. There were a few gotchas, such as having to enable > extension support because xend was sending back nil as a result, which > is only valid if extensions are enabled. Unfortunately, it appears > that xend was not honoring the fact that extension support is > negotiated.For the Xen-API work, we''re using this spec: http://www.xmlrpc.com/spec which doesn''t include <nil/>. I''d consider anything that was returning nil to be a bug. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 14:33:39 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 14:33:39 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWul1-00013W-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 14:33:39 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:52368 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HWukY-0006ay-1X (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 14:33:15 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWulF-0007ii-Ah; Thu, 29 Mar 2007 13:33:53 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWuks-0007QV-96 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:33:30 +0000 Received: from wx-out-0506.google.com ([66.249.82.226]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWukp-0007vj-Kx for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 13:33:28 +0000 Received: by wx-out-0506.google.com with SMTP id t14so161300wxc for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 06:32:09 -0700 (PDT) Received: by 10.90.49.1 with SMTP id w1mr440100agw.1175175129067; Thu, 29 Mar 2007 06:32:09 -0700 (PDT) Received: from ?192.168.1.104? ( [72.179.63.62]) by mx.google.com with ESMTP id 6sm781886wrh.2007.03.29.06.32.08; Thu, 29 Mar 2007 06:32:08 -0700 (PDT) Message-ID: <460BBFD5.3040404@codemonkey.ws> Date: Thu, 29 Mar 2007 08:32:05 -0500 From: Anthony Liguori <anthony@codemonkey.ws> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: Ray Kelm <kelmray@gmail.com> References: <460BB681.6070503@oracle.com> <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> In-Reply-To: <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 66.249.82.226 X-SA-Exim-Mail-From: anthony@codemonkey.ws X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Premjith Rayaroth <premjith.rayaroth@oracle.com>, xen-devel@lists.xensource.com Subject: [Xen-devel] Re: Java support for Xen APIs X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Ray Kelm wrote:> I''ve had some success using the apache xml-rpc library to access xen > with version 3.0.4. There were a few gotchas, such as having to enable > extension support because xend was sending back nil as a result, which > is only valid if extensions are enabled. Unfortunately, it appears > that xend was not honoring the fact that extension support is > negotiated.Extension support isn''t negotiated (at least, not by any API I know of). Do you have a reference for this? Regards, Anthony Liguori> It would be handy to have a packaged solution that exports a simple > api for talking to xend, as building some of the control structures is > a bit of a pain. > > -Ray > > > On 3/29/07, Premjith Rayaroth <premjith.rayaroth@oracle.com> wrote: >> Hi, >> >> Is Java support available for Xen APIs. Can I use Java to make XML-RPC >> calls to the Xen machines? I assume only ''C'' and ''Python'' are supported. >> Is there any plan to support Java. >> >> Thanks >> -Prem >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >>_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 14:51:51 2007 Return-path: <stefanb@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 14:51:51 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWv2d-0006gj-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 14:51:51 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from igw2.watson.ibm.com ([129.34.20.6]:41295) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HWv23-0008Dk-BV (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <stefanb@us.ibm.com>); Thu, 29 Mar 2007 14:51:16 +0100 Received: from mailhub3.watson.ibm.com (mailhub3.watson.ibm.com [129.34.20.45]) by igw2.watson.ibm.com (8.13.1/8.13.1/8.13.1-2005-04-25 igw) with ESMTP id l2TDqWCE008129; Thu, 29 Mar 2007 09:52:33 -0400 Received: from mailhub3.watson.ibm.com (localhost.localdomain [127.0.0.1]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-Delivery) with ESMTP id l2TDpBlk012410; Thu, 29 Mar 2007 09:51:11 -0400 Received: from 941e-2.watson.ibm.com (941e-2.watson.ibm.com [9.2.15.131]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-IMSS) with ESMTP id l2TDpBCK012407; Thu, 29 Mar 2007 09:51:11 -0400 Subject: Resubmit [PATCH] [XEN] [ACM] Allow choosing the VM label of dom0 in kernel line in grub.conf From: Stefan Berger <stefanb@us.ibm.com> To: xen-devel <xen-devel@lists.xensource.com> Cc: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Content-Type: multipart/mixed; boundary="=-OaWXeA/2DdYMAhuER9uQ" Date: Thu, 29 Mar 2007 09:55:58 -0400 Message-Id: <1175176558.3102.6.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) --=-OaWXeA/2DdYMAhuER9uQ Content-Type: text/plain Content-Transfer-Encoding: 7bit Changes to two files had escaped the previous submission. This patch provides the possibility to choose the VM label of domain-0 in the kernel line in grub.conf. The format is ssidref=<ssid ref>:sHype:<policy name>:<vm label>. The name of the policy specified here must be the same name as the in the policy provided as a module during boot, otherwise the policy will not be accepted and the system then starts without a policy. The user tool for ''xm dumppolicy'' has been adapted to show which entry in the binary policy is used by domain-0. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> --=-OaWXeA/2DdYMAhuER9uQ Content-Disposition: attachment; filename=acm_ssidref_grub.diff Content-Type: text/x-patch; name=acm_ssidref_grub.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit --- xen-unstable.hg/tools/security/secpol_tool.c | 59 +++++++++- xen-unstable.hg/tools/security/secpol_xml2bin.c | 3 xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c | 13 ++ xen-unstable.hg/xen/acm/acm_core.c | 65 ++++++++++-- xen-unstable.hg/xen/acm/acm_null_hooks.c | 2 xen-unstable.hg/xen/acm/acm_policy.c | 10 + xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c | 26 +++- xen-unstable.hg/xen/include/acm/acm_core.h | 9 + xen-unstable.hg/xen/include/acm/acm_hooks.h | 12 +- 9 files changed, 163 insertions(+), 36 deletions(-) Index: root/xen-unstable.hg/xen/acm/acm_core.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_core.c +++ root/xen-unstable.hg/xen/acm/acm_core.c @@ -62,18 +62,63 @@ struct acm_binary_policy acm_bin_pol; /* acm binary policy lock */ DEFINE_RWLOCK(acm_bin_pol_rwlock); +/* ACM''s only accepted policy name */ +char polname[80]; +char *acm_accepted_boot_policy_name = NULL; + +static void __init set_dom0_ssidref(const char *val) +{ + /* expected format: + ssidref=<hex number>:<policy name> + Policy name must not have a ''space''. + */ + const char *c; + int lo, hi; + int i; + int dom0_ssidref = simple_strtoull(val, &c, 0); + + if (!strncmp(&c[0],":sHype:", 7)) { + lo = dom0_ssidref & 0xffff; + if (lo < ACM_MAX_NUM_TYPES && lo >= 1) + dom0_chwall_ssidref = lo; + hi = dom0_ssidref >> 16; + if (hi < ACM_MAX_NUM_TYPES && hi >= 1) + dom0_ste_ssidref = hi; + for (i = 0; i < sizeof(polname); i++) { + polname[i] = c[7+i]; + if (polname[i] == ''\0'' || polname[i] == ''\t'' || + polname[i] == ''\n'' || polname[i] == '' '' || + polname[i] == '':'') { + break; + } + } + polname[i] = 0; + acm_accepted_boot_policy_name = polname; + } +} + +custom_param("ssidref", set_dom0_ssidref); + int acm_set_policy_reference(u8 *buf, u32 buf_size) { + char *name = (char *)(buf + sizeof(struct acm_policy_reference_buffer)); struct acm_policy_reference_buffer *pr = (struct acm_policy_reference_buffer *)buf; + + if (acm_accepted_boot_policy_name != NULL) { + if (strcmp(acm_accepted_boot_policy_name, name)) { + printk("Policy''s name ''%s'' is not the expected one ''%s''.\n", + name, acm_accepted_boot_policy_name); + return ACM_ERROR; + } + } + acm_bin_pol.policy_reference_name = (char *)xmalloc_array(u8, be32_to_cpu(pr->len)); if (!acm_bin_pol.policy_reference_name) return -ENOMEM; + strlcpy(acm_bin_pol.policy_reference_name, name, be32_to_cpu(pr->len)); - strlcpy(acm_bin_pol.policy_reference_name, - (char *)(buf + sizeof(struct acm_policy_reference_buffer)), - be32_to_cpu(pr->len)); printk("%s: Activating policy %s\n", __func__, acm_bin_pol.policy_reference_name); return 0; @@ -190,7 +235,8 @@ acm_is_policy(char *buf, unsigned long l static int acm_setup(char *policy_start, - unsigned long policy_len) + unsigned long policy_len, + int is_bootpolicy) { int rc = ACM_OK; struct acm_policy_buffer *pol; @@ -202,7 +248,8 @@ acm_setup(char *policy_start, if (be32_to_cpu(pol->magic) != ACM_MAGIC) return rc; - rc = do_acm_set_policy((void *)policy_start, (u32)policy_len); + rc = do_acm_set_policy((void *)policy_start, (u32)policy_len, + is_bootpolicy); if (rc == ACM_OK) { printkd("Policy len 0x%lx, start at %p.\n",policy_len,policy_start); @@ -224,7 +271,10 @@ acm_init(char *policy_start, int ret = ACM_OK; /* first try to load the boot policy (uses its own locks) */ - acm_setup(policy_start, policy_len); + acm_setup(policy_start, policy_len, 1); + + /* a user-provided policy may have any name; only matched during boot */ + acm_accepted_boot_policy_name = NULL; if (acm_active_security_policy != ACM_POLICY_UNDEFINED) { @@ -236,6 +286,9 @@ acm_init(char *policy_start, printk("%s: Loading default policy (%s).\n", __func__, ACM_POLICY_NAME(ACM_DEFAULT_SECURITY_POLICY)); + /* (re-)set dom-0 ssidref to default */ + dom0_ste_ssidref = dom0_chwall_ssidref = 0x0001; + if (acm_init_binary_policy(ACM_DEFAULT_SECURITY_POLICY)) { ret = -EINVAL; goto out; Index: root/xen-unstable.hg/xen/include/acm/acm_hooks.h ==================================================================--- root.orig/xen-unstable.hg/xen/include/acm/acm_hooks.h +++ root/xen-unstable.hg/xen/include/acm/acm_hooks.h @@ -91,7 +91,8 @@ struct acm_operations { int (*init_domain_ssid) (void **ssid, ssidref_t ssidref); void (*free_domain_ssid) (void *ssid); int (*dump_binary_policy) (u8 *buffer, u32 buf_size); - int (*set_binary_policy) (u8 *buffer, u32 buf_size); + int (*set_binary_policy) (u8 *buffer, u32 buf_size, + int is_bootpolicy); int (*dump_statistics) (u8 *buffer, u16 buf_size); int (*dump_ssid_types) (ssidref_t ssidref, u8 *buffer, u16 buf_size); /* domain management control hooks (can be NULL) */ @@ -347,14 +348,13 @@ static inline int acm_pre_grant_setup(do } } -/* predefined ssidref for DOM0 used by xen when creating DOM0 */ -#define ACM_DOM0_SSIDREF 0x00010001 - static inline void acm_post_domain0_create(domid_t domid) { /* initialialize shared sHype security labels for new domain */ - acm_init_domain_ssid(domid, ACM_DOM0_SSIDREF); - acm_post_domain_create(domid, ACM_DOM0_SSIDREF); + int dom0_ssidref = dom0_ste_ssidref << 16 | dom0_chwall_ssidref; + + acm_init_domain_ssid(domid, dom0_ssidref); + acm_post_domain_create(domid, dom0_ssidref); } static inline int acm_sharing(ssidref_t ssidref1, ssidref_t ssidref2) Index: root/xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c +++ root/xen-unstable.hg/xen/acm/acm_simple_type_enforcement_hooks.c @@ -31,6 +31,9 @@ #include <acm/acm_hooks.h> #include <asm/atomic.h> #include <acm/acm_endian.h> +#include <acm/acm_core.h> + +ssidref_t dom0_ste_ssidref = 0x0001; /* local cache structures for STE policy */ struct ste_binary_policy ste_bin_pol; @@ -74,15 +77,21 @@ int acm_init_ste_policy(void) { /* minimal startup policy; policy write-locked already */ ste_bin_pol.max_types = 1; - ste_bin_pol.max_ssidrefs = 2; - ste_bin_pol.ssidrefs = (domaintype_t *)xmalloc_array(domaintype_t, 2); - memset(ste_bin_pol.ssidrefs, 0, 2); + ste_bin_pol.max_ssidrefs = 1 + dom0_ste_ssidref; + ste_bin_pol.ssidrefs + (domaintype_t *)xmalloc_array(domaintype_t, + ste_bin_pol.max_types * + ste_bin_pol.max_ssidrefs); if (ste_bin_pol.ssidrefs == NULL) return ACM_INIT_SSID_ERROR; - /* initialize state so that dom0 can start up and communicate with itself */ - ste_bin_pol.ssidrefs[1] = 1; + memset(ste_bin_pol.ssidrefs, 0, sizeof(domaintype_t) * + ste_bin_pol.max_types * + ste_bin_pol.max_ssidrefs); + + /* initialize state so that dom0 can start up and communicate with itself */ + ste_bin_pol.ssidrefs[ste_bin_pol.max_types * dom0_ste_ssidref] = 1; /* init stats */ atomic_set(&(ste_bin_pol.ec_eval_count), 0); @@ -274,7 +283,7 @@ ste_init_state(struct acm_ste_policy_buf /* set new policy; policy write-locked already */ static int -ste_set_policy(u8 *buf, u32 buf_size) +ste_set_policy(u8 *buf, u32 buf_size, int is_bootpolicy) { struct acm_ste_policy_buffer *ste_buf = (struct acm_ste_policy_buffer *)buf; void *ssidrefsbuf; @@ -305,6 +314,11 @@ ste_set_policy(u8 *buf, u32 buf_size) if (ste_buf->ste_ssid_offset + sizeof(domaintype_t) * ste_buf->ste_max_ssidrefs*ste_buf->ste_max_types > buf_size) goto error_free; + /* during boot dom0_chwall_ssidref is set */ + if (is_bootpolicy && (dom0_ste_ssidref >= ste_buf->ste_max_ssidrefs)) { + goto error_free; + } + arrcpy(ssidrefsbuf, buf + ste_buf->ste_ssid_offset, sizeof(domaintype_t), Index: root/xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c +++ root/xen-unstable.hg/xen/acm/acm_chinesewall_hooks.c @@ -41,6 +41,9 @@ #include <acm/acm_core.h> #include <acm/acm_hooks.h> #include <acm/acm_endian.h> +#include <acm/acm_core.h> + +ssidref_t dom0_chwall_ssidref = 0x0001; /* local cache structures for chinese wall policy */ struct chwall_binary_policy chwall_bin_pol; @@ -53,7 +56,7 @@ int acm_init_chwall_policy(void) { /* minimal startup policy; policy write-locked already */ chwall_bin_pol.max_types = 1; - chwall_bin_pol.max_ssidrefs = 2; + chwall_bin_pol.max_ssidrefs = 1 + dom0_chwall_ssidref; chwall_bin_pol.max_conflictsets = 1; chwall_bin_pol.ssidrefs (domaintype_t *) xmalloc_array(domaintype_t, @@ -254,7 +257,7 @@ chwall_init_state(struct acm_chwall_poli * more than one type is currently running */ } -static int chwall_set_policy(u8 * buf, u32 buf_size) +static int chwall_set_policy(u8 * buf, u32 buf_size, int is_bootpolicy) { /* policy write-locked already */ struct acm_chwall_policy_buffer *chwall_buf @@ -286,6 +289,12 @@ static int chwall_set_policy(u8 * buf, u (chwall_buf->policy_version != ACM_CHWALL_VERSION)) return -EINVAL; + /* during boot dom0_chwall_ssidref is set */ + if (is_bootpolicy && + (dom0_chwall_ssidref >= chwall_buf->chwall_max_ssidrefs)) { + goto error_free; + } + /* 1. allocate new buffers */ ssids xmalloc_array(domaintype_t, Index: root/xen-unstable.hg/tools/security/secpol_tool.c ==================================================================--- root.orig/xen-unstable.hg/tools/security/secpol_tool.c +++ root/xen-unstable.hg/tools/security/secpol_tool.c @@ -57,7 +57,7 @@ void usage(char *progname) /*************************** DUMPS *******************************/ -void acm_dump_chinesewall_buffer(void *buf, int buflen) +void acm_dump_chinesewall_buffer(void *buf, int buflen, uint16_t chwall_ref) { struct acm_chwall_policy_buffer *cwbuf @@ -91,6 +91,8 @@ void acm_dump_chinesewall_buffer(void *b for (j = 0; j < ntohl(cwbuf->chwall_max_types); j++) printf("%02x ", ntohs(ssids[i * ntohl(cwbuf->chwall_max_types) + j])); + if (i == chwall_ref) + printf(" <-- Domain-0"); } printf("\n\nConfict Sets:\n"); conflicts @@ -131,7 +133,7 @@ void acm_dump_chinesewall_buffer(void *b } } -void acm_dump_ste_buffer(void *buf, int buflen) +void acm_dump_ste_buffer(void *buf, int buflen, uint16_t ste_ref) { struct acm_ste_policy_buffer *stebuf @@ -158,11 +160,14 @@ void acm_dump_ste_buffer(void *buf, int for (j = 0; j < ntohl(stebuf->ste_max_types); j++) printf("%02x ", ntohs(ssids[i * ntohl(stebuf->ste_max_types) + j])); + if (i == ste_ref) + printf(" <-- Domain-0"); } printf("\n\n"); } -void acm_dump_policy_buffer(void *buf, int buflen) +void acm_dump_policy_buffer(void *buf, int buflen, + uint16_t chwall_ref, uint16_t ste_ref) { struct acm_policy_buffer *pol = (struct acm_policy_buffer *) buf; char *policy_reference_name @@ -190,13 +195,15 @@ void acm_dump_policy_buffer(void *buf, i acm_dump_chinesewall_buffer(ALIGN8(buf + ntohl(pol->primary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->primary_buffer_offset)); + ntohl(pol->primary_buffer_offset), + chwall_ref); break; case ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY: acm_dump_ste_buffer(ALIGN8(buf + ntohl(pol->primary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->primary_buffer_offset)); + ntohl(pol->primary_buffer_offset), + ste_ref); break; case ACM_NULL_POLICY: @@ -212,13 +219,15 @@ void acm_dump_policy_buffer(void *buf, i acm_dump_chinesewall_buffer(ALIGN8(buf + ntohl(pol->secondary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->secondary_buffer_offset)); + ntohl(pol->secondary_buffer_offset), + chwall_ref); break; case ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY: acm_dump_ste_buffer(ALIGN8(buf + ntohl(pol->secondary_buffer_offset)), ntohl(pol->len) - - ntohl(pol->secondary_buffer_offset)); + ntohl(pol->secondary_buffer_offset), + ste_ref); break; case ACM_NULL_POLICY: @@ -230,6 +239,27 @@ void acm_dump_policy_buffer(void *buf, i } } +/************************** get dom0 ssidref *****************************/ +int acm_get_ssidref(int xc_handle, int domid, uint16_t *chwall_ref, + uint16_t *ste_ref) +{ + int ret; + struct acm_getssid getssid; + char buf[4096]; + struct acm_ssid_buffer *ssid = (struct acm_ssid_buffer *)buf; + getssid.interface_version = ACM_INTERFACE_VERSION; + set_xen_guest_handle(getssid.ssidbuf, buf); + getssid.ssidbuf_size = sizeof(buf); + getssid.get_ssid_by = ACM_GETBY_domainid; + getssid.id.domainid = domid; + ret = xc_acm_op(xc_handle, ACMOP_getssid, &getssid, sizeof(getssid)); + if (ret == 0) { + *chwall_ref = ssid->ssidref & 0xffff; + *ste_ref = ssid->ssidref >> 16; + } + return ret; +} + /******************************* get policy ******************************/ #define PULL_CACHE_SIZE 8192 @@ -239,12 +269,16 @@ int acm_domain_getpolicy(int xc_handle) { struct acm_getpolicy getpolicy; int ret; + uint16_t chwall_ref, ste_ref; memset(pull_buffer, 0x00, sizeof(pull_buffer)); getpolicy.interface_version = ACM_INTERFACE_VERSION; set_xen_guest_handle(getpolicy.pullcache, pull_buffer); getpolicy.pullcache_size = sizeof(pull_buffer); ret = xc_acm_op(xc_handle, ACMOP_getpolicy, &getpolicy, sizeof(getpolicy)); + if (ret >= 0) { + ret = acm_get_ssidref(xc_handle, 0, &chwall_ref, &ste_ref); + } if (ret < 0) { printf("ACM operation failed: errno=%d\n", errno); @@ -254,7 +288,9 @@ int acm_domain_getpolicy(int xc_handle) } /* dump policy */ - acm_dump_policy_buffer(pull_buffer, sizeof(pull_buffer)); + acm_dump_policy_buffer(pull_buffer, sizeof(pull_buffer), + chwall_ref, ste_ref); + return ret; } @@ -266,6 +302,7 @@ int acm_domain_loadpolicy(int xc_handle, int ret, fd; off_t len; uint8_t *buffer; + uint16_t chwall_ssidref, ste_ssidref; if ((ret = stat(filename, &mystat))) { printf("File %s not found.\n", filename); @@ -282,10 +319,14 @@ int acm_domain_loadpolicy(int xc_handle, printf("File %s not found.\n", filename); goto free_out; } + ret =acm_get_ssidref(xc_handle, 0, &chwall_ssidref, &ste_ssidref); + if (ret < 0) { + goto free_out; + } if (len == read(fd, buffer, len)) { struct acm_setpolicy setpolicy; /* dump it and then push it down into xen/acm */ - acm_dump_policy_buffer(buffer, len); + acm_dump_policy_buffer(buffer, len, chwall_ssidref, ste_ssidref); setpolicy.interface_version = ACM_INTERFACE_VERSION; set_xen_guest_handle(setpolicy.pushcache, buffer); setpolicy.pushcache_size = len; Index: root/xen-unstable.hg/tools/security/secpol_xml2bin.c ==================================================================--- root.orig/xen-unstable.hg/tools/security/secpol_xml2bin.c +++ root/xen-unstable.hg/tools/security/secpol_xml2bin.c @@ -1163,7 +1163,8 @@ int write_binary(char *filename) u_int32_t len_ste = 0, len_chwall = 0, len_pr = 0; /* length of policy components */ - sscanf(policy_version_string,"%d.%d", &major, &minor); + if (policy_version_string) + sscanf(policy_version_string,"%d.%d", &major, &minor); /* open binary file */ if ((fd Index: root/xen-unstable.hg/xen/include/acm/acm_core.h ==================================================================--- root.orig/xen-unstable.hg/xen/include/acm/acm_core.h +++ root/xen-unstable.hg/xen/include/acm/acm_core.h @@ -123,13 +123,20 @@ int acm_init_domain_ssid(domid_t id, ssi void acm_free_domain_ssid(struct acm_ssid_domain *ssid); int acm_init_binary_policy(u32 policy_code); int acm_set_policy(XEN_GUEST_HANDLE(void) buf, u32 buf_size); -int do_acm_set_policy(void *buf, u32 buf_size); +int do_acm_set_policy(void *buf, u32 buf_size, int is_bootpolicy); int acm_get_policy(XEN_GUEST_HANDLE(void) buf, u32 buf_size); int acm_dump_statistics(XEN_GUEST_HANDLE(void) buf, u16 buf_size); int acm_get_ssid(ssidref_t ssidref, XEN_GUEST_HANDLE(void) buf, u16 buf_size); int acm_get_decision(ssidref_t ssidref1, ssidref_t ssidref2, u32 hook); int acm_set_policy_reference(u8 * buf, u32 buf_size); int acm_dump_policy_reference(u8 *buf, u32 buf_size); + + +/* variables */ +extern ssidref_t dom0_chwall_ssidref; +extern ssidref_t dom0_ste_ssidref; +#define ACM_MAX_NUM_TYPES (256) + #endif /* Index: root/xen-unstable.hg/xen/acm/acm_null_hooks.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_null_hooks.c +++ root/xen-unstable.hg/xen/acm/acm_null_hooks.c @@ -33,7 +33,7 @@ null_dump_binary_policy(u8 *buf, u32 buf } static int -null_set_binary_policy(u8 *buf, u32 buf_size) +null_set_binary_policy(u8 *buf, u32 buf_size, int is_bootpolicy) { return ACM_OK; } Index: root/xen-unstable.hg/xen/acm/acm_policy.c ==================================================================--- root.orig/xen-unstable.hg/xen/acm/acm_policy.c +++ root/xen-unstable.hg/xen/acm/acm_policy.c @@ -50,7 +50,7 @@ acm_set_policy(XEN_GUEST_HANDLE(void) bu printk("%s: Error copying!\n",__func__); goto error_free; } - ret = do_acm_set_policy(policy_buffer, buf_size); + ret = do_acm_set_policy(policy_buffer, buf_size, 0); error_free: xfree(policy_buffer); @@ -59,7 +59,7 @@ acm_set_policy(XEN_GUEST_HANDLE(void) bu int -do_acm_set_policy(void *buf, u32 buf_size) +do_acm_set_policy(void *buf, u32 buf_size, int is_bootpolicy) { struct acm_policy_buffer *pol = (struct acm_policy_buffer *)buf; uint32_t offset, length; @@ -106,14 +106,16 @@ do_acm_set_policy(void *buf, u32 buf_siz length = be32_to_cpu(pol->secondary_buffer_offset) - offset; if ( (offset + length) > buf_size || - acm_primary_ops->set_binary_policy(buf + offset, length)) + acm_primary_ops->set_binary_policy(buf + offset, length, + is_bootpolicy)) goto error_lock_free; /* set secondary policy data */ offset = be32_to_cpu(pol->secondary_buffer_offset); length = be32_to_cpu(pol->len) - offset; if ( (offset + length) > buf_size || - acm_secondary_ops->set_binary_policy(buf + offset, length)) + acm_secondary_ops->set_binary_policy(buf + offset, length, + is_bootpolicy)) goto error_lock_free; memcpy(&acm_bin_pol.xml_pol_version, --=-OaWXeA/2DdYMAhuER9uQ-- From xen-devel-bounces.xensource.com Thu Mar 29 15:40:36 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 15:40:36 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWvno-0002IZ-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 15:40:36 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:47323 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HWvn5-0000Wk-PY (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 15:39:56 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWvnk-0001jR-5m; Thu, 29 Mar 2007 14:40:32 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWvnL-0001R4-Bo for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:40:07 +0000 Received: from nf-out-0910.google.com ([64.233.182.189]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWvnI-0008N2-MB for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:40:05 +0000 Received: by nf-out-0910.google.com with SMTP id q29so195259nfc for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 07:38:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WmI1LJDoe8HlD1CXnySKmMOOPm0K3xHcbtOvMT7X3leIckj1O0m1MfkoMBYyEMJlpJTTImcF8NYWZNWU9QyYyUcDesUV4NzA0ET2RinJX+Djpm/5BzmpK6oa2vWSdcxQTxPqcaxF6fTzuTfnmodFWCjMquKXOAa2Vlm0/ioqTMADomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FzUunMKRmlyNc0l5RAXsJIbaTYtFpYkXMzhe+DQ+/mI2vwSqdevu2HEqyzDwFDLeKjn67fsiEtBeWsprSaiG69CtIEOTeMqEvcqh0sc9q2nB1W6vGoscjC2L3phTsPOANlaH3+5MLVsyrnitt+gM6oGd7y26Tbn4PZJI9f8sEuIReceived: by 10.82.134.12 with SMTP id h12mr1598913bud.1175179136778; Thu, 29 Mar 2007 07:38:56 -0700 (PDT) Received: by 10.82.180.7 with HTTP; Thu, 29 Mar 2007 07:38:56 -0700 (PDT) Message-ID: <383b9200703290738u64606e45n738be707b0664c7b@mail.gmail.com> Date: Thu, 29 Mar 2007 10:38:56 -0400 From: "Ray Kelm" <kelmray@gmail.com> To: "Anthony Liguori" <anthony@codemonkey.ws> In-Reply-To: <460BBFD5.3040404@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <460BB681.6070503@oracle.com> <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> <460BBFD5.3040404@codemonkey.ws> X-SA-Exim-Connect-IP: 64.233.182.189 X-SA-Exim-Mail-From: kelmray@gmail.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Premjith Rayaroth <premjith.rayaroth@oracle.com>, xen-devel@lists.xensource.com Subject: [Xen-devel] Re: Java support for Xen APIs X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com I''m sorry, I should have been more clear. Apache xml-rpc has support for vendor extensions, which violate the original xml-rpc spec. In order for them to be enabled, their client library negotiates with the server implementation, and only if both sides have extensions enabled does it support them. The expected situation is that if a non-apache client accesses an apache server, it won''t ask for extensions, so the server will not use them. If an apache client accesses an non-apache server, the negotiation is ignored, so the client disables the extensions. One of those extensions is support for returning a null value (or python''s None in this case) as <nil> or maybe <ex:nil>. The python xmlrpc code does this apparently by default, when you call a method that has no return value, for example, xend.domain.unpause. Here''s some information about the extensions supported by apache''s library. http://ws.apache.org/xmlrpc/extensions.html In the end, I was unable to get it to work because xend wasn''t responding in a way that apache recognized, so it was disabling extensions. I had to add a custom handler for <nil> using a class based on TypeFactoryImpl, which solved the problem nicely. -Ray On 3/29/07, Anthony Liguori <anthony@codemonkey.ws> wrote:> Ray Kelm wrote: > > I''ve had some success using the apache xml-rpc library to access xen > > with version 3.0.4. There were a few gotchas, such as having to enable > > extension support because xend was sending back nil as a result, which > > is only valid if extensions are enabled. Unfortunately, it appears > > that xend was not honoring the fact that extension support is > > negotiated. > > Extension support isn''t negotiated (at least, not by any API I know of). > Do you have a reference for this? > > Regards, > > Anthony Liguori > > > > It would be handy to have a packaged solution that exports a simple > > api for talking to xend, as building some of the control structures is > > a bit of a pain. > > > > -Ray > > > > > > On 3/29/07, Premjith Rayaroth <premjith.rayaroth@oracle.com> wrote: > >> Hi, > >> > >> Is Java support available for Xen APIs. Can I use Java to make XML-RPC > >> calls to the Xen machines? I assume only ''C'' and ''Python'' are supported. > >> Is there any plan to support Java. > >> > >> Thanks > >> -Prem > >> > >> _______________________________________________ > >> Xen-devel mailing list > >> Xen-devel@lists.xensource.com > >> http://lists.xensource.com/xen-devel > >> > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 15:53:19 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 15:53:19 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWw07-0002Wv-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 15:53:19 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:51663 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HWvz2-0003aK-9z (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 15:52:17 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWvzn-0002BR-6w; Thu, 29 Mar 2007 14:52:59 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWvzL-0001rQ-MJ for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:52:31 +0000 Received: from mu-out-0910.google.com ([209.85.134.186]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWvzE-00005K-Tf for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:52:29 +0000 Received: by mu-out-0910.google.com with SMTP id w1so206119mue for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 07:51:17 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gjNImjnACd36Jz9GfxxYSXRxRyMmjXsK6gk7juFaz8RDUyL23dBzZBTlIyqiWtdziI6aWCaTwdMfPQmC2iRTXp34Ukr4poWDiuS5OdLbe3FkoQGmKNhlvSXwr678NdnmpYn6O8RPZFd00efqIUuV1ozRr92Ue+0k3QLmaUzY9e8DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EMOupcMAf0tq9zcZfp0pZyz9IXubGaIIB4SZzkMbllFUlUXzJQxXW/NqAG/Pq8jhBpbe9m1wkY/t57O/2aho1wMZMa7sX5jJYwM1QDgDbHD659HJDLPFTunKxSFeed7f98s+k+RLmLtqP63GzzgNHBFcSK5jMa/EaBkhF9uvuAoReceived: by 10.82.155.10 with SMTP id c10mr1655371bue.1175179876642; Thu, 29 Mar 2007 07:51:16 -0700 (PDT) Received: by 10.82.180.7 with HTTP; Thu, 29 Mar 2007 07:51:16 -0700 (PDT) Message-ID: <383b9200703290751i1508d000na2689941d744a872@mail.gmail.com> Date: Thu, 29 Mar 2007 10:51:16 -0400 From: "Ray Kelm" <kelmray@gmail.com> To: "Anthony Liguori" <anthony@codemonkey.ws> In-Reply-To: <383b9200703290738u64606e45n738be707b0664c7b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <460BB681.6070503@oracle.com> <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> <460BBFD5.3040404@codemonkey.ws> <383b9200703290738u64606e45n738be707b0664c7b@mail.gmail.com> X-SA-Exim-Connect-IP: 209.85.134.186 X-SA-Exim-Mail-From: kelmray@gmail.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Premjith Rayaroth <premjith.rayaroth@oracle.com>, xen-devel@lists.xensource.com Subject: [Xen-devel] Re: Java support for Xen APIs X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Hmm. Looking a little deeper, I find that I''m not really using the new Xen API calls, but in fact, the older xml-rpc interface. I guess I have some work to do to get my code running using the correct calls. After looking at the code in XendAPI.py, VM.unpause will end up returning xen_api_success_void(), which will not be a nil. It is only the older api that was returning None directly, which resulted in <nil> in the xml-rpc response. My bad. -Ray On 3/29/07, Ray Kelm <kelmray@gmail.com> wrote:> I''m sorry, I should have been more clear. Apache xml-rpc has support > for vendor extensions, which violate the original xml-rpc spec. In > order for them to be enabled, their client library negotiates with the > server implementation, and only if both sides have extensions enabled > does it support them. The expected situation is that if a non-apache > client accesses an apache server, it won''t ask for extensions, so the > server will not use them. If an apache client accesses an non-apache > server, the negotiation is ignored, so the client disables the > extensions. > > One of those extensions is support for returning a null value (or > python''s None in this case) as <nil> or maybe <ex:nil>. The python > xmlrpc code does this apparently by default, when you call a method > that has no return value, for example, xend.domain.unpause. > > Here''s some information about the extensions supported by apache''s > library. http://ws.apache.org/xmlrpc/extensions.html > > In the end, I was unable to get it to work because xend wasn''t > responding in a way that apache recognized, so it was disabling > extensions. I had to add a custom handler for <nil> using a class > based on TypeFactoryImpl, which solved the problem nicely. > > -Ray > > On 3/29/07, Anthony Liguori <anthony@codemonkey.ws> wrote: > > Ray Kelm wrote: > > > I''ve had some success using the apache xml-rpc library to access xen > > > with version 3.0.4. There were a few gotchas, such as having to enable > > > extension support because xend was sending back nil as a result, which > > > is only valid if extensions are enabled. Unfortunately, it appears > > > that xend was not honoring the fact that extension support is > > > negotiated. > > > > Extension support isn''t negotiated (at least, not by any API I know of). > > Do you have a reference for this? > > > > Regards, > > > > Anthony Liguori > > > > > > > It would be handy to have a packaged solution that exports a simple > > > api for talking to xend, as building some of the control structures is > > > a bit of a pain. > > > > > > -Ray > > > > > > > > > On 3/29/07, Premjith Rayaroth <premjith.rayaroth@oracle.com> wrote: > > >> Hi, > > >> > > >> Is Java support available for Xen APIs. Can I use Java to make XML-RPC > > >> calls to the Xen machines? I assume only ''C'' and ''Python'' are supported. > > >> Is there any plan to support Java. > > >> > > >> Thanks > > >> -Prem > > >> > > >> _______________________________________________ > > >> Xen-devel mailing list > > >> Xen-devel@lists.xensource.com > > >> http://lists.xensource.com/xen-devel > > >> > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 15:57:32 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 15:57:32 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWw4C-0007y1-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 15:57:32 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:35758 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWw3W-0006M7-80 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 15:56:55 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWw4H-0002ZJ-KG; Thu, 29 Mar 2007 14:57:37 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWw3r-0002Gn-9n for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:57:11 +0000 Received: from 207.47.60.150.static.nextweb.net ([207.47.60.150] helo=webmail.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWw3o-00005x-L7 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:57:09 +0000 Received: from leeni.uk.xensource.com ([172.31.0.52]) by webmail.xensource.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 06:55:57 -0800 Received: from emellor by leeni.uk.xensource.com with local (Exim 4.50) id 1HWw2f-0001Cu-1m; Thu, 29 Mar 2007 15:55:57 +0100 Date: Thu, 29 Mar 2007 15:55:57 +0100 From: Ewan Mellor <ewan@xensource.com> To: Ray Kelm <kelmray@gmail.com> Message-ID: <20070329145557.GO16195@leeni.uk.xensource.com> References: <460BB681.6070503@oracle.com> <383b9200703290558u6373385eg896358398716337c@mail.gmail.com> <460BBFD5.3040404@codemonkey.ws> <383b9200703290738u64606e45n738be707b0664c7b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <383b9200703290738u64606e45n738be707b0664c7b@mail.gmail.com> User-Agent: Mutt/1.5.9i X-OriginalArrivalTime: 29 Mar 2007 14:55:58.0089 (UTC) FILETIME=[5BF1A790:01C77212] X-SA-Exim-Connect-IP: 207.47.60.150 X-SA-Exim-Mail-From: ewan@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Re: Java support for Xen APIs X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Premjith Rayaroth <premjith.rayaroth@oracle.com>, xen-devel@lists.xensource.com, Anthony Liguori <anthony@codemonkey.ws> X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Thu, Mar 29, 2007 at 10:38:56AM -0400, Ray Kelm wrote:> I''m sorry, I should have been more clear. Apache xml-rpc has support > for vendor extensions, which violate the original xml-rpc spec. In > order for them to be enabled, their client library negotiates with the > server implementation, and only if both sides have extensions enabled > does it support them. The expected situation is that if a non-apache > client accesses an apache server, it won''t ask for extensions, so the > server will not use them. If an apache client accesses an non-apache > server, the negotiation is ignored, so the client disables the > extensions. > > One of those extensions is support for returning a null value (or > python''s None in this case) as <nil> or maybe <ex:nil>. The python > xmlrpc code does this apparently by default, when you call a method > that has no return value, for example, xend.domain.unpause.xend.domain.unpause is one of the legacy XML-RPC methods, and not part of the Xen-API. If you try VM.unpause you should get a quite different result. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 16:02:36 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 16:02:36 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWw96-00084J-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 16:02:36 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, HTML_MESSAGE 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:38277 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HWw62-0004xG-OZ (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 15:59:31 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWw6n-0002w9-Tu; Thu, 29 Mar 2007 15:00:13 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWw6F-0002e1-Kr for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:59:39 +0000 Received: from usea-naimss1.unisys.com ([192.61.61.103]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWw6C-00007S-Ko for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:59:37 +0000 Received: from usea-nagw1.na.uis.unisys.com ([129.224.72.16]) by usea-naimss1 with InterScan Message Security Suite; Thu, 29 Mar 2007 09:58:13 -0500 Received: from usea-nagw1.na.uis.unisys.com ([129.224.72.51]) by usea-nagw1.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 09:58:12 -0500 Received: from USTR-EXCH5.na.uis.unisys.com ([192.63.225.140]) by usea-nagw1.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 09:58:12 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 29 Mar 2007 10:58:09 -0400 Message-ID: <B05D2E415E8CC94897BB44233D14EE68057B54C1@USTR-EXCH5.na.uis.unisys.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Odd CPU Scheduling Behavior Thread-Index: AcdyEqoY2lwl6GDzSom5tvvwfsw7sw=From: "Carb, Brian A" <Brian.Carb@unisys.com> To: <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 29 Mar 2007 14:58:12.0871 (UTC) FILETIME=[AC47C170:01C77212] X-SA-Exim-Connect-IP: 192.61.61.103 X-SA-Exim-Mail-From: Brian.Carb@unisys.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,HTML_40_50, HTML_MESSAGE autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Odd CPU Scheduling Behavior X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============1744754640==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. --===============1744754640=Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C77212.AA774044" This is a multi-part message in MIME format. ------_=_NextPart_001_01C77212.AA774044 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable We''re seeing a cpu scheduling behavior in Xen and we''re wondering if anyone can explain it. =20 We''re running XEN 3.0.4 on a Unisys ES7000/one with 8 CPUs (4 dual-core sockets) and 32GB memory. XEN is built on SLES10, and the system is booted with dom0_mem=3D512mb. We have 2 para-virtual machines, each booted with 2 vcpus and 2GB memory, and each running SLES10 and Apache2 with worker multi-processing modules. =20 The vcpus of dom0, vm1 and vm2 are pinned as follows: =20 dom0 is relegated to 2 vcpus (xm vcpu-set 0 2) and these are pinned to cpus 0-1 vm1 uses 2 vcpus pinned to cpus 2-3 vm2 uses 2 vcpus pinned to cpus 2-3 =20 The cpus 4 through 7 are left unused. =20 Our test runs http_load against the Apache2 web servers in the 2 vms. Since Apache2 is using worker multi-processing modules, we expect that each vm will spread its load over the 2 vcpus, and during the test we have verified this using top and sar inside a vm console. =20 The odd behavior occurs when we monitor cpu usage using xenmon in interactive mode. By pressing "c", we can observe the load on each of the cpus. When we examine cpus 2 and 3 initially, each is used equally by vm1 and vm2. However, shortly after we start our testing, cpu2 runs vm1 exclusively 100% of the time, and cpu3 runs vm2 100% of the time. When the test completes, CPUs 2 and 3 go back to sharing the load of vm1 and vm2. =20 Is this the expected behavior? brian carb unisys corporation - malvern, pa ------_=_NextPart_001_01C77212.AA774044 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.6000.16414" name=3DGENERATOR></HEAD> <BODY> <DIV><FONT face=3D"Comic Sans MS" size=3D2>We''re seeing a cpu scheduling behavior in=20 Xen and we''re wondering if anyone can explain it.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Comic Sans MS" size=3D2>We''re running XEN 3.0.4 on a Unisys=20 ES7000/one with 8 CPUs (4 dual-core sockets) and 32GB memory. XEN is built on=20 SLES10, and the system is booted with dom0_mem=3D512mb. We have 2 para-virtual=20 machines, each booted with 2 vcpus and 2GB memory, and each running SLES10 and=20 Apache2 with worker multi-processing modules.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Comic Sans MS" size=3D2>The vcpus of dom0, vm1 and vm2 are pinned=20 as follows:</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Comic Sans MS" size=3D2>dom0 is relegated to 2 vcpus (xm vcpu-set=20 0 2) and these are pinned to cpus 0-1<BR>vm1 uses 2 vcpus pinned to cpus 2-3<BR>vm2 uses 2 vcpus pinned to cpus 2-3</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Comic Sans MS" size=3D2>The cpus 4 through 7 are left unused.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Comic Sans MS" size=3D2>Our test runs http_load against the=20 Apache2 web servers in the 2 vms. Since Apache2 is using worker multi-processing=20 modules, we expect that each vm will spread its load over the 2 vcpus, and=20 during the test we have verified this using top and sar inside a vm=20 console.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Comic Sans MS" size=3D2>The odd behavior occurs when we monitor=20 cpu usage using xenmon in interactive mode. By pressing "c", we can observe the=20 load on each of the cpus. When we examine cpus 2 and 3 initially, each is used=20 equally by vm1 and vm2. However, shortly after we start our testing, cpu2 runs=20 vm1 exclusively 100% of the time, and cpu3 runs vm2 100% of the time. When=20 the test completes, CPUs 2 and 3 go back to sharing the load of vm1 and=20 vm2.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Comic Sans MS" size=3D2>Is this the expected=20 behavior?</FONT></DIV> <DIV class=3DSection1> <P class=3DMsoNormal><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: ''Comic Sans MS''">brian carb</SPAN><BR><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: ''Comic Sans MS''">unisys corporation -=20 malvern, pa</SPAN></P></DIV></BODY></HTML> ------_=_NextPart_001_01C77212.AA774044-- --===============1744754640=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1744754640==-- From xen-devel-bounces.xensource.com Thu Mar 29 16:45:47 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 16:45:47 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWwot-0003c5-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 16:45:47 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:42955 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HWwmB-0000LG-3C (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 16:43:05 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWwmv-0004FM-UB; Thu, 29 Mar 2007 15:43:45 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWwmV-0003xY-Lp for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 15:43:19 +0000 Received: from ug-out-1314.google.com ([66.249.92.175]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWwmS-0000Ln-Uv for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 15:43:17 +0000 Received: by ug-out-1314.google.com with SMTP id y2so702989uge for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 08:42:08 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; b=IryUkNw4jun6tJKW8VQ2Mz7kwhKea577kW5cbQ7SccEcv3xO5I6hAQCImqj/CGnNqLHPgqRcjbHCn4pSKlosdSpB/QQGoqru3NVBWLVD59mFgqD4fseVIqVg9TKQWt/+pSQclJPW362CnUA69Y4yHIPclsMbb7PG0bSgd99ogiYDomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; b=JoHQAe6OpVE5NNEsd30V2KusXVMWGrjrjPogy1QrWxypcFyMrp/mCI8vQIC0IomtOGwBAo/03XT4H0vhJ4Di0w0qNeWNEZ7P8ucureI4LfUqPKIK7ceur0MmIRCPbYQivN8OJMQy2Zq87Jl2CzCjrr5bsU3eitz9/A1czbCR/NYReceived: by 10.66.224.19 with SMTP id w19mr1272239ugg.1175182928875; Thu, 29 Mar 2007 08:42:08 -0700 (PDT) Received: from ?192.168.2.130? ( [83.157.52.224]) by mx.google.com with ESMTP id x33sm1674348ugc.2007.03.29.08.42.07; Thu, 29 Mar 2007 08:42:07 -0700 (PDT) In-Reply-To: <B05D2E415E8CC94897BB44233D14EE68057B54C1@USTR-EXCH5.na.uis.unisys.com> References: <B05D2E415E8CC94897BB44233D14EE68057B54C1@USTR-EXCH5.na.uis.unisys.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <ac269497563576fac1573da5b4bd1800@gmail.com> Content-Transfer-Encoding: quoted-printable From: Emmanuel Ackaouy <ackaouy@gmail.com> Date: Thu, 29 Mar 2007 17:42:04 +0200 To: "Carb, Brian A" <Brian.Carb@unisys.com> X-Mailer: Apple Mail (2.624) X-SA-Exim-Connect-IP: 66.249.92.175 X-SA-Exim-Mail-From: ackaouy@gmail.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Odd CPU Scheduling Behavior X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com There is no gang scheduling in Xen so what you see is not unexpected. Both VCPUs of the same VM are as likely to run on the same physical CPU than not. For each VM though, both its VCPUs should get equal CPU time if they are runnable even if they alternatively run on the same physical CPU. I have seen some multithreaded applications/libraries back off using execution vehicles (processes) to schedule a runnable thread when it doesn''t seem to make forward progress, probably because some code somewhere assumes another process is hogging the CPU and it''s therefore better to lower the number of execution vehicles. In this case, multithreaded apps running on a 2CPU guest on Xen sometimes only schedule work on 1CPU when there is another VM competing for the physical CPU resources. Are both VCPUs of each VM making forward progress during your test? On Mar 29, 2007, at 16:58, Carb, Brian A wrote:> We''re seeing a cpu scheduling behavior in Xen and we''re wondering if=20 > anyone can explain it. > =A0 > We''re running XEN 3.0.4 on a Unisys ES7000/one with 8 CPUs (4=20 > dual-core sockets) and 32GB memory. XEN is built on SLES10, and the=20 > system is booted with dom0_mem=3D512mb. We have 2 para-virtual machines,=20 > each booted with 2 vcpus and 2GB memory, and each running SLES10 and=20 > Apache2 with worker multi-processing modules. > =A0 > The vcpus of dom0, vm1 and vm2 are pinned as follows: > =A0 > dom0 is relegated to 2 vcpus (xm vcpu-set 0 2) and these are pinned to=20 > cpus 0-1 > vm1 uses 2 vcpus pinned to cpus 2-3 > vm2 uses 2 vcpus pinned to cpus 2-3 > =A0 > The cpus 4 through 7 are left unused. > =A0 > Our test runs http_load against the Apache2 web servers in the 2 vms.=20 > Since Apache2 is using worker multi-processing modules, we expect that=20 > each vm will spread its load over the 2 vcpus, and during the test we=20 > have verified this using top and sar inside a vm console. > =A0 > The odd behavior occurs when we monitor cpu usage using xenmon in=20 > interactive mode. By pressing "c", we can observe the load on each of=20 > the cpus. When we examine cpus 2 and 3 initially, each is used equally=20 > by vm1 and vm2. However, shortly after we start our testing, cpu2 runs=20 > vm1 exclusively 100% of the time, and cpu3 runs vm2 100% of the time.=A0=20 > When the test completes, CPUs 2 and 3 go back to sharing the load of=20 > vm1 and vm2. > =A0 > Is this the expected behavior? > > brian carb > unisys corporation - malvern,=20 > pa_______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 16:59:48 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 16:59:48 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWx2S-0003rK-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 16:59:48 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:50158 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HWx1j-0002XE-VJ (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 16:59:08 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWx2S-0005Ra-AA; Thu, 29 Mar 2007 15:59:48 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWx25-00059M-OL for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 15:59:25 +0000 Received: from usea-naimss2.unisys.com ([192.61.61.104]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWx22-0000Yo-N2 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 15:59:23 +0000 Received: from usea-nagw3.na.uis.unisys.com ([129.224.72.20]) by usea-naimss2 with InterScan Message Security Suite; Thu, 29 Mar 2007 10:57:53 -0500 Received: from usea-nagw3.na.uis.unisys.com ([129.224.72.55]) by usea-nagw3.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 10:57:52 -0500 Received: from USTR-EXCH5.na.uis.unisys.com ([192.63.225.140]) by usea-nagw3.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 10:57:51 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Mar 2007 11:57:50 -0400 Message-ID: <B05D2E415E8CC94897BB44233D14EE68057B55CA@USTR-EXCH5.na.uis.unisys.com> In-Reply-To: <ac269497563576fac1573da5b4bd1800@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] Odd CPU Scheduling Behavior Thread-Index: AcdyGNGSXA757vdhTIWQBRAkSqIdaQAAEK5g References: <B05D2E415E8CC94897BB44233D14EE68057B54C1@USTR-EXCH5.na.uis.unisys.com> <ac269497563576fac1573da5b4bd1800@gmail.com> From: "Carb, Brian A" <Brian.Carb@unisys.com> To: "Emmanuel Ackaouy" <ackaouy@gmail.com> X-OriginalArrivalTime: 29 Mar 2007 15:57:51.0718 (UTC) FILETIME=[01707860:01C7721B] X-SA-Exim-Connect-IP: 192.61.61.104 X-SA-Exim-Mail-From: Brian.Carb@unisys.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] Odd CPU Scheduling Behavior X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Emmanuel, Yes - both vcpus are progressing, but the load gets pushed to one cpu. If I run top in interactive mode in each vm while the test is running, and monitor cpu usage (set delay to 1 and show separate cpu states), each of the vm''s cpus are getting equally loaded on average. There are a few more oddities:=20 First, I see this behavior almost all the time when I run the test. However, occasionally, I do not see this behavior at all, and the load stays spread out on both cpus for the duration of the test (2 minutes). Second, if I boot my ES7000/one to use only 4 CPUs (2 dual-core sockets), the load always stays evenly distributed on both cpus. brian carb unisys corporation - malvern, pa -----Original Message----- From: Emmanuel Ackaouy [mailto:ackaouy@gmail.com]=20 Sent: Thursday, March 29, 2007 11:42 AM To: Carb, Brian A Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] Odd CPU Scheduling Behavior There is no gang scheduling in Xen so what you see is not unexpected. Both VCPUs of the same VM are as likely to run on the same physical CPU than not. For each VM though, both its VCPUs should get equal CPU time if they are runnable even if they alternatively run on the same physical CPU. I have seen some multithreaded applications/libraries back off using execution vehicles (processes) to schedule a runnable thread when it doesn''t seem to make forward progress, probably because some code somewhere assumes another process is hogging the CPU and it''s therefore better to lower the number of execution vehicles. In this case, multithreaded apps running on a 2CPU guest on Xen sometimes only schedule work on 1CPU when there is another VM competing for the physical CPU resources. Are both VCPUs of each VM making forward progress during your test? On Mar 29, 2007, at 16:58, Carb, Brian A wrote:> We''re seeing a cpu scheduling behavior in Xen and we''re wondering if=20 > anyone can explain it. > =A0 > We''re running XEN 3.0.4 on a Unisys ES7000/one with 8 CPUs (4=20 > dual-core sockets) and 32GB memory. XEN is built on SLES10, and the=20 > system is booted with dom0_mem=3D512mb. We have 2 para-virtual machines,=20 > each booted with 2 vcpus and 2GB memory, and each running SLES10 and > Apache2 with worker multi-processing modules. > =A0 > The vcpus of dom0, vm1 and vm2 are pinned as follows: > =A0 > dom0 is relegated to 2 vcpus (xm vcpu-set 0 2) and these are pinned to > cpus 0-1 > vm1 uses 2 vcpus pinned to cpus 2-3 > vm2 uses 2 vcpus pinned to cpus 2-3 > =A0 > The cpus 4 through 7 are left unused. > =A0 > Our test runs http_load against the Apache2 web servers in the 2 vms.=20 > Since Apache2 is using worker multi-processing modules, we expect that > each vm will spread its load over the 2 vcpus, and during the test we=20 > have verified this using top and sar inside a vm console. > =A0 > The odd behavior occurs when we monitor cpu usage using xenmon in=20 > interactive mode. By pressing "c", we can observe the load on each of=20 > the cpus. When we examine cpus 2 and 3 initially, each is used equally > by vm1 and vm2. However, shortly after we start our testing, cpu2 runs > vm1 exclusively 100% of the time, and cpu3 runs vm2 100% of the time.=20 > When the test completes, CPUs 2 and 3 go back to sharing the load of > vm1 and vm2. > =A0 > Is this the expected behavior? > > brian carb > unisys corporation - malvern, > pa_______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 17:06:29 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 17:06:29 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWx8v-0003z9-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 17:06:29 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:33424 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HWx8L-0003j9-Aj (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 17:05:58 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWx95-0005xE-UH; Thu, 29 Mar 2007 16:06:39 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWx8h-0005de-4u for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:06:15 +0000 Received: from outbound-dub.frontbridge.com ([213.199.154.16] helo=outbound2-dub-R.bigfish.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWx8e-0000Zb-2N for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:06:13 +0000 Received: from outbound2-dub.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound2-dub-R.bigfish.com (Postfix) with ESMTP id 1DD5ED64CF4; Thu, 29 Mar 2007 16:05:02 +0000 (UTC) Received: from mail6-dub-R.bigfish.com (unknown [10.5.252.3]) by outbound2-dub.bigfish.com (Postfix) with ESMTP id F34C01930043; Thu, 29 Mar 2007 16:05:01 +0000 (UTC) Received: from mail6-dub (localhost.localdomain [127.0.0.1]) by mail6-dub-R.bigfish.com (Postfix) with ESMTP id D94E1D02D1; Thu, 29 Mar 2007 16:05:01 +0000 (UTC) X-BigFish: VP Received: by mail6-dub (MessageSwitch) id 1175184301805797_14951; Thu, 29 Mar 2007 16:05:01 +0000 (UCT) Received: from svlb1extmailp01.amd.com (unknown [139.95.251.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail6-dub.bigfish.com (Postfix) with ESMTP id 3C61B8C0055; Thu, 29 Mar 2007 16:05:01 +0000 (UTC) Received: from SSVLGW01.amd.com (ssvlgw01.amd.com [139.95.250.169]) by svlb1extmailp01.amd.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2TG4rsl022479; Thu, 29 Mar 2007 09:04:56 -0700 Received: from 139.95.53.183 by SSVLGW02.amd.com with ESMTP (AMD SMTP Relay (Email Firewall v6.1.0)); Thu, 29 Mar 2007 08:04:51 -0800 X-Server-Uuid: 519AC16A-9632-469E-B354-112C592D09E8 Received: from ssvlexmb2.amd.com ([139.95.53.7]) by SSVLEXBH2.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 09:04:51 -0700 Received: from SF30EXMB1.amd.com ([172.20.6.49]) by ssvlexmb2.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 09:04:50 -0700 Received: from sefsexmb1.amd.com ([165.204.82.123]) by SF30EXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 18:04:36 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 29 Mar 2007 18:03:49 +0200 Message-ID: <907625E08839C4409CE5768403633E0B018E1B4E@sefsexmb1.amd.com> In-Reply-To: <B05D2E415E8CC94897BB44233D14EE68057B55CA@USTR-EXCH5.na.uis.unisys.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] Odd CPU Scheduling Behavior Thread-Index: AcdyGNGSXA757vdhTIWQBRAkSqIdaQAAEK5gAACWGQAFrom: "Petersson, Mats" <Mats.Petersson@amd.com> To: "Carb, Brian A" <Brian.Carb@unisys.com>, "Emmanuel Ackaouy" <ackaouy@gmail.com> X-OriginalArrivalTime: 29 Mar 2007 16:04:36.0888 (UTC) FILETIME=[F2F08180:01C7721B] X-WSS-ID: 6A153C292X04116544-01-01 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 213.199.154.16 X-SA-Exim-Mail-From: Mats.Petersson@amd.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] Odd CPU Scheduling Behavior X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com =20> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com=20 > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of=20 > Carb, Brian A > Sent: 29 March 2007 16:58 > To: Emmanuel Ackaouy > Cc: xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] Odd CPU Scheduling Behavior >=20 > Emmanuel, >=20 > Yes - both vcpus are progressing, but the load gets pushed to=20 > one cpu. If I run top in interactive mode in each vm while=20 > the test is running, and monitor cpu usage (set delay to 1=20 > and show separate cpu states), each of the vm''s cpus are=20 > getting equally loaded on average. >=20 > There are a few more oddities:=20 >=20 > First, I see this behavior almost all the time when I run the=20 > test. However, occasionally, I do not see this behavior at=20 > all, and the load stays spread out on both cpus for the=20 > duration of the test (2 minutes).Whilst I have no idea as to the answer of the original question, I would like to point out that the scenario where two CPU-bound threads on a dual core processor and four VCPU''s sharing the same domain sharing the same core is probably better for cache-hit-rate than sharing the VCPU''s evenly over the CPU-cores, and if I had a say in the design, I would aim to keep it that way. [This may not be trivial to achieve, but if what you''re saying is correct, then it''s a GOOD THING(tm)].=20 -- Mats>=20 > Second, if I boot my ES7000/one to use only 4 CPUs (2=20 > dual-core sockets), the load always stays evenly distributed=20 > on both cpus. >=20 > brian carb > unisys corporation - malvern, pa >=20 > -----Original Message----- > From: Emmanuel Ackaouy [mailto:ackaouy@gmail.com]=20 > Sent: Thursday, March 29, 2007 11:42 AM > To: Carb, Brian A > Cc: xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] Odd CPU Scheduling Behavior >=20 > There is no gang scheduling in Xen so what you see is not unexpected. > Both VCPUs of the same VM are as likely to run on the same=20 > physical CPU than not. For each VM though, both its VCPUs=20 > should get equal CPU time if they are runnable even if they=20 > alternatively run on the same physical CPU. >=20 > I have seen some multithreaded applications/libraries back=20 > off using execution vehicles (processes) to schedule a=20 > runnable thread when it doesn''t seem to make forward=20 > progress, probably because some code somewhere assumes=20 > another process is hogging the CPU and it''s therefore better=20 > to lower the number of execution vehicles. In this case,=20 > multithreaded apps running on a 2CPU guest on Xen sometimes=20 > only schedule work on 1CPU when there is another VM competing=20 > for the physical CPU resources. >=20 > Are both VCPUs of each VM making forward progress during your test? >=20 > On Mar 29, 2007, at 16:58, Carb, Brian A wrote: >=20 > > We''re seeing a cpu scheduling behavior in Xen and we''re=20 > wondering if=20 > > anyone can explain it. > > =A0 > > We''re running XEN 3.0.4 on a Unisys ES7000/one with 8 CPUs (4=20 > > dual-core sockets) and 32GB memory. XEN is built on SLES10, and the=20 > > system is booted with dom0_mem=3D512mb. We have 2=20 > para-virtual machines,=20 > > each booted with 2 vcpus and 2GB memory, and each running SLES10 and > > Apache2 with worker multi-processing modules. > > =A0 > > The vcpus of dom0, vm1 and vm2 are pinned as follows: > > =A0 > > dom0 is relegated to 2 vcpus (xm vcpu-set 0 2) and these=20 > are pinned to=20 > > cpus 0-1 > > vm1 uses 2 vcpus pinned to cpus 2-3 > > vm2 uses 2 vcpus pinned to cpus 2-3 > > =A0 > > The cpus 4 through 7 are left unused. > > =A0 > > Our test runs http_load against the Apache2 web servers in=20 > the 2 vms.=20 > > Since Apache2 is using worker multi-processing modules, we=20 > expect that=20 > > each vm will spread its load over the 2 vcpus, and during=20 > the test we=20 > > have verified this using top and sar inside a vm console. > > =A0 > > The odd behavior occurs when we monitor cpu usage using xenmon in=20 > > interactive mode. By pressing "c", we can observe the load=20 > on each of=20 > > the cpus. When we examine cpus 2 and 3 initially, each is=20 > used equally=20 > > by vm1 and vm2. However, shortly after we start our=20 > testing, cpu2 runs > > vm1 exclusively 100% of the time, and cpu3 runs vm2 100% of=20 > the time.=20 > > When the test completes, CPUs 2 and 3 go back to sharing the load of > > vm1 and vm2. > > =A0 > > Is this the expected behavior? > > > > brian carb > > unisys corporation - malvern, > > pa_______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >=20 >=20 >=20_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 17:07:02 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 17:07:02 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWx9S-00010P-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 17:07:02 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, HTML_MESSAGE 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:45836 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HWx99-0004CI-CG (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 17:06:48 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWx9u-0006Lv-Ok; Thu, 29 Mar 2007 16:07:30 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWx9W-00061z-8c for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:07:06 +0000 Received: from outbound-cpk.frontbridge.com ([207.46.163.16] helo=outbound4-cpk-R.bigfish.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWx9T-0000a8-7o for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:07:04 +0000 Received: from outbound4-cpk.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound4-cpk-R.bigfish.com (Postfix) with ESMTP id AD82F91B274; Thu, 29 Mar 2007 16:05:52 +0000 (UTC) Received: from mail4-cpk-R.bigfish.com (unknown [192.168.21.3]) by outbound4-cpk.bigfish.com (Postfix) with ESMTP id A5ACE91B1AE; Thu, 29 Mar 2007 16:05:52 +0000 (UTC) Received: from mail4-cpk.bigfish.com (localhost.localdomain [127.0.0.1]) by mail4-cpk-R.bigfish.com (Postfix) with ESMTP id 9A6A27B3CA4; Thu, 29 Mar 2007 16:05:52 +0000 (UTC) X-BigFish: VP Received: by mail4-cpk (MessageSwitch) id 1175184352543157_6184; Thu, 29 Mar 2007 16:05:52 +0000 (UCT) Received: from ausb3extmailp01.amd.com (unknown [163.181.251.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by mail4-cpk.bigfish.com (Postfix) with ESMTP id 62FCF7B3BC6; Thu, 29 Mar 2007 16:05:52 +0000 (UTC) Received: from SAUSGW02.amd.com (sausgw02.amd.com [163.181.250.22]) by ausb3extmailp01.amd.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2TG5gTq008875; Thu, 29 Mar 2007 11:05:48 -0500 Received: from 163.181.22.102 by SAUSGW01.amd.com with ESMTP (AMD SMTP Relay (Email Firewall v6.1.0)); Thu, 29 Mar 2007 11:05:42 -0500 X-Server-Uuid: 8C3DB987-180B-4465-9446-45C15473FD3E Received: from sausexmb2.amd.com ([163.181.3.157]) by sausexbh2.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 11:05:42 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 29 Mar 2007 11:05:41 -0500 Message-ID: <7D748C767B7FA541A8AC5504A4C89A23015685FC@SAUSEXMB2.amd.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: P2M Top Level Page Table Thread-Index: AcdyHBl6ROin1Ah6Tnm0i91fEIxX9g=From: "Huang2, Wei" <Wei.Huang2@amd.com> To: xen-devel@lists.xensource.com, "Tim Deegan" <Tim.Deegan@xensource.com> X-OriginalArrivalTime: 29 Mar 2007 16:05:42.0117 (UTC) FILETIME=[19D1A950:01C7721C] X-WSS-ID: 6A153C5C2EW2576020-01-01 X-SA-Exim-Connect-IP: 207.46.163.16 X-SA-Exim-Mail-From: Wei.Huang2@amd.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,HTML_MESSAGE autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] P2M Top Level Page Table X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0861079948==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. --===============0861079948=Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7721C.1988E871" This is a multi-part message in MIME format. ------_=_NextPart_001_01C7721C.1988E871 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Current P2M table are allocated through alloc_domheap_pages(), which can potentially allocate memory with physical address > 4G under PAE mode. However, for top level P2M table (under PAE mode), its physical address should be below 4G because CR3 has only 32 bits. I noticed that mm.c relies on pae_l3_cache to solve this problem in make_cr3(). Do we plan to have similar solution for P2M table? Another solution might use xmalloc; but I just wonder whether it always returns memory below 4G.=20 =20 Any though? =20 Thanks, =20 -Wei ------_=_NextPart_001_01C7721C.1988E871 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2900.3059" name=3DGENERATOR></HEAD> <BODY> <DIV><SPAN class=3D066314615-29032007><FONT face=3DArial size=3D2>Current P2M table=20 are allocated through alloc_domheap_pages(), which can potentially allocate=20 memory with physical address > 4G under PAE mode. However, for top level=20 P2M table (under PAE mode), its physical address should be below 4G because CR3=20 has only 32 bits. I noticed that mm.c relies on pae_l3_cache to solve this=20 problem in make_cr3(). Do we plan to have similar solution for P2M table?=20 Another solution might use xmalloc; but I just wonder whether it always returns=20 memory below 4G. </FONT></SPAN></DIV> <DIV><SPAN class=3D066314615-29032007><FONT face=3DArial=20 size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D066314615-29032007><FONT face=3DArial size=3D2>Any=20 though?</FONT></SPAN></DIV> <DIV><SPAN class=3D066314615-29032007><FONT face=3DArial=20 size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D066314615-29032007><FONT face=3DArial=20 size=3D2>Thanks,</FONT></SPAN></DIV> <DIV><SPAN class=3D066314615-29032007><FONT face=3DArial=20 size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D066314615-29032007><FONT face=3DArial=20 size=3D2>-Wei</FONT></SPAN></DIV></BODY></HTML> ------_=_NextPart_001_01C7721C.1988E871-- --===============0861079948=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0861079948==-- From xen-devel-bounces.xensource.com Thu Mar 29 17:10:28 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 17:10:28 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWxCm-00014G-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 17:10:28 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:53590 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWxCQ-0003SR-6T (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 17:10:11 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxDB-0006mN-1l; Thu, 29 Mar 2007 16:10:53 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxCl-0006Tq-Q2 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:10:27 +0000 Received: from 207.47.60.150.static.nextweb.net ([207.47.60.150] helo=webmail.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWxCj-0000b3-3J for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:10:25 +0000 Received: from leeni.uk.xensource.com ([172.31.0.52]) by webmail.xensource.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 08:09:12 -0800 Received: from emellor by leeni.uk.xensource.com with local (Exim 4.50) id 1HWxBX-0007hF-Rm; Thu, 29 Mar 2007 17:09:11 +0100 Date: Thu, 29 Mar 2007 17:09:11 +0100 From: Ewan Mellor <ewan@xensource.com> To: Stefan Berger <stefanb@us.ibm.com> Message-ID: <20070329160911.GP16195@leeni.uk.xensource.com> References: <1173806784.13832.4.camel@gsal-3.watson.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1173806784.13832.4.camel@gsal-3.watson.ibm.com> User-Agent: Mutt/1.5.9i X-OriginalArrivalTime: 29 Mar 2007 16:09:14.0540 (UTC) FILETIME=[986ED6C0:01C7721C] X-SA-Exim-Connect-IP: 207.47.60.150 X-SA-Exim-Mail-From: ewan@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com Subject: [Xen-devel] Re: [PATCH] [libxen] Serialization of sets with strings X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Tue, Mar 13, 2007 at 01:26:24PM -0400, Stefan Berger wrote:> This patch adds serialization of sets with strings. I recursified the > serialization. Only sets with strings are supported so far. > > Signed-off-by: Stefan Berger <stefanb@us.ibm.com>Applied, thanks Stefan. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 17:31:23 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 17:31:23 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWxX1-0001Wh-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 17:31:23 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:51364 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HWxW8-0002d0-BA (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 17:30:33 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxWt-0008RC-R3; Thu, 29 Mar 2007 16:31:15 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxWX-000894-3R for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:30:53 +0000 Received: from mga03.intel.com ([143.182.124.21]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWxWR-0000lu-UI for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:30:51 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 29 Mar 2007 09:29:36 -0700 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by azsmga001.ch.intel.com with ESMTP; 29 Mar 2007 09:29:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,347,1170662400"; d="scan''208"; a="205011566:sNHT29604925" Received: from fmsmsx411.amr.corp.intel.com ([10.19.28.152]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 09:29:35 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Mar 2007 09:29:33 -0700 Message-ID: <AF358A0C5B36EC4486D1A764A171904DE5E656@fmsmsx411.amr.corp.intel.com> In-Reply-To: <907625E08839C4409CE5768403633E0B018E1B4E@sefsexmb1.amd.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] Odd CPU Scheduling Behavior Thread-Index: AcdyGNGSXA757vdhTIWQBRAkSqIdaQAAEK5gAACWGQAAANN6AA=From: "Apparao, Padmashree K" <padmashree.k.apparao@intel.com> To: "Petersson, Mats" <Mats.Petersson@amd.com>, "Carb, Brian A" <Brian.Carb@unisys.com>, "Emmanuel Ackaouy" <ackaouy@gmail.com> X-OriginalArrivalTime: 29 Mar 2007 16:29:35.0844 (UTC) FILETIME=[70630A40:01C7721F] X-SA-Exim-Connect-IP: 143.182.124.21 X-SA-Exim-Mail-From: padmashree.k.apparao@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] Odd CPU Scheduling Behavior X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This behavior of 2+ vcpus sharing the same pcpu is good only if there in data sharing between the vcpus, so the cache performance would be better. But in the case of apps (like SPECjbb for instance) where there is absolutely no sharing it may be beneficial to having the vcpus run in parallel on the different pcpus. On another note is there a way to modify the scheduler such that with no affinity assigned, I can get the vcpu/VMid and pcpu combination every few seconds during a run. Thanks - Padma -----Original Message----- From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Petersson, Mats Sent: Thursday, March 29, 2007 9:04 AM To: Carb, Brian A; Emmanuel Ackaouy Cc: xen-devel@lists.xensource.com Subject: RE: [Xen-devel] Odd CPU Scheduling Behavior =20> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com=20 > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of=20 > Carb, Brian A > Sent: 29 March 2007 16:58 > To: Emmanuel Ackaouy > Cc: xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] Odd CPU Scheduling Behavior >=20 > Emmanuel, >=20 > Yes - both vcpus are progressing, but the load gets pushed to=20 > one cpu. If I run top in interactive mode in each vm while=20 > the test is running, and monitor cpu usage (set delay to 1=20 > and show separate cpu states), each of the vm''s cpus are=20 > getting equally loaded on average. >=20 > There are a few more oddities:=20 >=20 > First, I see this behavior almost all the time when I run the=20 > test. However, occasionally, I do not see this behavior at=20 > all, and the load stays spread out on both cpus for the=20 > duration of the test (2 minutes).Whilst I have no idea as to the answer of the original question, I would like to point out that the scenario where two CPU-bound threads on a dual core processor and four VCPU''s sharing the same domain sharing the same core is probably better for cache-hit-rate than sharing the VCPU''s evenly over the CPU-cores, and if I had a say in the design, I would aim to keep it that way. [This may not be trivial to achieve, but if what you''re saying is correct, then it''s a GOOD THING(tm)].=20 -- Mats>=20 > Second, if I boot my ES7000/one to use only 4 CPUs (2=20 > dual-core sockets), the load always stays evenly distributed=20 > on both cpus. >=20 > brian carb > unisys corporation - malvern, pa >=20 > -----Original Message----- > From: Emmanuel Ackaouy [mailto:ackaouy@gmail.com]=20 > Sent: Thursday, March 29, 2007 11:42 AM > To: Carb, Brian A > Cc: xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] Odd CPU Scheduling Behavior >=20 > There is no gang scheduling in Xen so what you see is not unexpected. > Both VCPUs of the same VM are as likely to run on the same=20 > physical CPU than not. For each VM though, both its VCPUs=20 > should get equal CPU time if they are runnable even if they=20 > alternatively run on the same physical CPU. >=20 > I have seen some multithreaded applications/libraries back=20 > off using execution vehicles (processes) to schedule a=20 > runnable thread when it doesn''t seem to make forward=20 > progress, probably because some code somewhere assumes=20 > another process is hogging the CPU and it''s therefore better=20 > to lower the number of execution vehicles. In this case,=20 > multithreaded apps running on a 2CPU guest on Xen sometimes=20 > only schedule work on 1CPU when there is another VM competing=20 > for the physical CPU resources. >=20 > Are both VCPUs of each VM making forward progress during your test? >=20 > On Mar 29, 2007, at 16:58, Carb, Brian A wrote: >=20 > > We''re seeing a cpu scheduling behavior in Xen and we''re=20 > wondering if=20 > > anyone can explain it. > > =A0 > > We''re running XEN 3.0.4 on a Unisys ES7000/one with 8 CPUs (4=20 > > dual-core sockets) and 32GB memory. XEN is built on SLES10, and the=20 > > system is booted with dom0_mem=3D512mb. We have 2=20 > para-virtual machines,=20 > > each booted with 2 vcpus and 2GB memory, and each running SLES10 and > > Apache2 with worker multi-processing modules. > > =A0 > > The vcpus of dom0, vm1 and vm2 are pinned as follows: > > =A0 > > dom0 is relegated to 2 vcpus (xm vcpu-set 0 2) and these=20 > are pinned to=20 > > cpus 0-1 > > vm1 uses 2 vcpus pinned to cpus 2-3 > > vm2 uses 2 vcpus pinned to cpus 2-3 > > =A0 > > The cpus 4 through 7 are left unused. > > =A0 > > Our test runs http_load against the Apache2 web servers in=20 > the 2 vms.=20 > > Since Apache2 is using worker multi-processing modules, we=20 > expect that=20 > > each vm will spread its load over the 2 vcpus, and during=20 > the test we=20 > > have verified this using top and sar inside a vm console. > > =A0 > > The odd behavior occurs when we monitor cpu usage using xenmon in=20 > > interactive mode. By pressing "c", we can observe the load=20 > on each of=20 > > the cpus. When we examine cpus 2 and 3 initially, each is=20 > used equally=20 > > by vm1 and vm2. However, shortly after we start our=20 > testing, cpu2 runs > > vm1 exclusively 100% of the time, and cpu3 runs vm2 100% of=20 > the time.=20 > > When the test completes, CPUs 2 and 3 go back to sharing the load of > > vm1 and vm2. > > =A0 > > Is this the expected behavior? > > > > brian carb > > unisys corporation - malvern, > > pa_______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >=20 >=20 >=20_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 17:44:06 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 17:44:06 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWxjK-0002EJ-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 17:44:06 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.254, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:57738 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HWxiJ-0007Go-0V (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 17:43:08 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxj1-00014P-DD; Thu, 29 Mar 2007 16:43:47 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxic-0000ls-02 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:43:22 +0000 Received: from 207.47.60.4.static.nextweb.net ([207.47.60.4] helo=rpc.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWxiX-0000nk-Dc for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:43:19 +0000 Received: from 217.46.209.99 ([217.46.209.99]) by exchpamain.ad.xensource.com ([192.168.3.25]) via Exchange Front-End Server rpc.xensource.com ([192.168.3.26]) with Microsoft Exchange Server HTTP-DAV ; Thu, 29 Mar 2007 16:42:05 +0000 User-Agent: Microsoft-Entourage/11.2.5.060620 Date: Thu, 29 Mar 2007 17:41:52 +0100 From: Keir Fraser <keir@xensource.com> To: "Huang2, Wei" <Wei.Huang2@amd.com>, <xen-devel@lists.xensource.com>, Tim Deegan <Tim.Deegan@xensource.com> Message-ID: <C231AAE0.C8A4%keir@xensource.com> Thread-Topic: [Xen-devel] P2M Top Level Page Table Thread-Index: AcdyHBl6ROin1Ah6Tnm0i91fEIxX9gABQ2wV In-Reply-To: <7D748C767B7FA541A8AC5504A4C89A23015685FC@SAUSEXMB2.amd.com> Mime-version: 1.0 X-SA-Exim-Connect-IP: 207.47.60.4 X-SA-Exim-Mail-From: Keir.Fraser@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,HTML_40_50,HTML_MESSAGE,RCVD_NUMERIC_HELO autolearn=no version=3.1.0 Subject: Re: [Xen-devel] P2M Top Level Page Table X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0180389925==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com> This message is in MIME format. Since your mail reader does not understandthis format, some or all of this message may not be legible. --===============0180389925=Content-type: multipart/alternative; boundary="B_3258034912_66162790"> This message is in MIME format. Since your mail reader does not understandthis format, some or all of this message may not be legible. --B_3258034912_66162790 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit PAE shadow mode always points CR3 at v->arch.paging.shadow.l3table[], which is guaranteed below 4GB and is a cache of the shadow entries. So it does not matter at all whether the P2M root table is above 4GB. -- Keir On 29/3/07 17:05, "Huang2, Wei" <Wei.Huang2@amd.com> wrote:> Current P2M table are allocated through alloc_domheap_pages(), which can > potentially allocate memory with physical address > 4G under PAE mode. > However, for top level P2M table (under PAE mode), its physical address should > be below 4G because CR3 has only 32 bits. I noticed that mm.c relies on > pae_l3_cache to solve this problem in make_cr3(). Do we plan to have similar > solution for P2M table? Another solution might use xmalloc; but I just wonder > whether it always returns memory below 4G. > > Any though? > > Thanks, > > -Wei > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel--B_3258034912_66162790 Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable <HTML> <HEAD> <TITLE>Re: [Xen-devel] P2M Top Level Page Table</TITLE> </HEAD> <BODY> <FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYLE=3D''font-size:12.0px''>PAE shadow mode always points CR3 at v->arch.paging.shadow.l3table[], which is guaranteed below 4GB and is a cache of the shadow entries. So it does not matter at all whether the P2M root table is above 4GB.<BR> <BR> -- Keir<BR> <BR> On 29/3/07 17:05, "Huang2, Wei" <Wei.Huang2@amd.com> wrote:<BR> <BR> </SPAN></FONT><BLOCKQUOTE><SPAN STYLE=3D''font-size:12.0px''><FONT FACE=3D"Arial">Current P2M table are allocated through alloc_domheap_pages(), which can potentially allocate memory with physical address > 4G under PAE mode. However, for top level P2M table (under PAE mode), its physical address should be below 4G because CR3 has only 32 bits. I noticed that mm.c relies on pae_l3_cache to solve this problem in make_cr3(). Do we plan to have similar solution for P2M table? Another solution might use xmalloc; but I just wonder whether it always returns memory below 4G. <BR> </FONT><FONT FACE=3D"Verdana, Helvetica, Arial"> <BR> </FONT><FONT FACE=3D"Arial">Any though?<BR> </FONT><FONT FACE=3D"Verdana, Helvetica, Arial"> <BR> </FONT><FONT FACE=3D"Arial">Thanks,<BR> </FONT><FONT FACE=3D"Verdana, Helvetica, Arial"> <BR> </FONT><FONT FACE=3D"Arial">-Wei<BR> </FONT><FONT FACE=3D"Verdana, Helvetica, Arial"><BR> <HR ALIGN=3DCENTER SIZE=3D"3" WIDTH=3D"95%"></FONT></SPAN><FONT SIZE=3D"2"><FONT FACE=3D"Monaco, Courier New"><SPAN STYLE=3D''font-size:10.0px''>_______________________________________________<BR> Xen-devel mailing list<BR> Xen-devel@lists.xensource.com<BR> <a href=3D"http://lists.xensource.com/xen-devel">http://lists.xensource.com/xen-devel</a><BR> </SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE=3D"2"><FONT FACE=3D"Monaco, Courier New"><SPAN STYLE=3D''font-size:10.0px''><BR> </SPAN></FONT></FONT> </BODY> </HTML> --B_3258034912_66162790-- --===============0180389925=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0180389925==-- From xen-devel-bounces.xensource.com Thu Mar 29 17:48:30 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 17:48:30 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWxna-0002KG-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 17:48:30 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, HTML_MESSAGE 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:53355 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWxn5-0007xc-9d (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 17:48:05 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxnk-0001Xy-CM; Thu, 29 Mar 2007 16:48:40 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxnL-0001G9-Ho for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:48:15 +0000 Received: from outbound-dub.frontbridge.com ([213.199.154.16] helo=outbound3-dub-R.bigfish.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWxnI-0000pE-PM for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:48:13 +0000 Received: from outbound3-dub.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound3-dub-R.bigfish.com (Postfix) with ESMTP id D7B31142C6B6; Thu, 29 Mar 2007 16:47:02 +0000 (UTC) Received: from mail56-dub-R.bigfish.com (unknown [10.5.252.3]) by outbound3-dub.bigfish.com (Postfix) with ESMTP id BF0C51F806F; Thu, 29 Mar 2007 16:47:02 +0000 (UTC) Received: from mail56-dub (localhost.localdomain [127.0.0.1]) by mail56-dub-R.bigfish.com (Postfix) with ESMTP id 6679884011F; Thu, 29 Mar 2007 16:47:02 +0000 (UTC) X-BigFish: VP Received: by mail56-dub (MessageSwitch) id 1175186822125579_28579; Thu, 29 Mar 2007 16:47:02 +0000 (UCT) Received: from ausb3extmailp01.amd.com (unknown [163.181.251.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail56-dub.bigfish.com (Postfix) with ESMTP id 4AA731B18069; Thu, 29 Mar 2007 16:47:00 +0000 (UTC) Received: from SAUSGW02.amd.com (sausgw02.amd.com [163.181.250.22]) by ausb3extmailp01.amd.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2TGkns2020420; Thu, 29 Mar 2007 10:46:52 -0600 Received: from 163.181.22.101 by SAUSGW02.amd.com with ESMTP (AMD SMTP Relay (Email Firewall v6.1.0)); Thu, 29 Mar 2007 11:46:46 -0500 X-Server-Uuid: 5FC0E2DF-CD44-48CD-883A-0ED95B391E89 Received: from sausexmb2.amd.com ([163.181.3.157]) by sausexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 11:46:46 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 29 Mar 2007 11:46:46 -0500 Message-ID: <7D748C767B7FA541A8AC5504A4C89A23015685FF@SAUSEXMB2.amd.com> In-Reply-To: <C231AAE0.C8A4%keir@xensource.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] P2M Top Level Page Table Thread-Index: AcdyHBl6ROin1Ah6Tnm0i91fEIxX9gABQ2wVAAAJnUAReferences: <7D748C767B7FA541A8AC5504A4C89A23015685FC@SAUSEXMB2.amd.com> <C231AAE0.C8A4%keir@xensource.com> From: "Huang2, Wei" <Wei.Huang2@amd.com> To: "Keir Fraser" <keir@xensource.com>, xen-devel@lists.xensource.com, "Tim Deegan" <Tim.Deegan@xensource.com> X-OriginalArrivalTime: 29 Mar 2007 16:46:46.0367 (UTC) FILETIME=[D6A05EF0:01C77221] X-WSS-ID: 6A1532FC3282596839-01-01 X-SA-Exim-Connect-IP: 213.199.154.16 X-SA-Exim-Mail-From: Wei.Huang2@amd.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,HTML_50_60,HTML_MESSAGE autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] P2M Top Level Page Table X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0481690416==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. --===============0481690416=Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C77221.D67904C0" This is a multi-part message in MIME format. ------_=_NextPart_001_01C77221.D67904C0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable My question is about h_cr3 in VMCB under hap mode. It points to the top level of P2M table, which might be located in memory space beyond 4GB. It can cause problem potentially. =20 -Wei ________________________________ From: Keir Fraser [mailto:keir@xensource.com]=20 Sent: Thursday, March 29, 2007 11:42 AM To: Huang2, Wei; xen-devel@lists.xensource.com; Tim Deegan Subject: Re: [Xen-devel] P2M Top Level Page Table PAE shadow mode always points CR3 at v->arch.paging.shadow.l3table[], which is guaranteed below 4GB and is a cache of the shadow entries. So it does not matter at all whether the P2M root table is above 4GB. -- Keir On 29/3/07 17:05, "Huang2, Wei" <Wei.Huang2@amd.com> wrote: Current P2M table are allocated through alloc_domheap_pages(), which can potentially allocate memory with physical address > 4G under PAE mode. However, for top level P2M table (under PAE mode), its physical address should be below 4G because CR3 has only 32 bits. I noticed that mm.c relies on pae_l3_cache to solve this problem in make_cr3(). Do we plan to have similar solution for P2M table? Another solution might use xmalloc; but I just wonder whether it always returns memory below 4G.=20 =09 Any though? =09 Thanks, =09 -Wei =09 =09 ________________________________ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel =09 ------_=_NextPart_001_01C77221.D67904C0 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Re: [Xen-devel] P2M Top Level Page Table</TITLE> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2900.3059" name=3DGENERATOR></HEAD> <BODY> <DIV dir=3Dltr align=3Dleft><SPAN class=3D508564216-29032007><FONT face=3DArial=20 color=3D#0000ff size=3D2>My question is about h_cr3 in VMCB under hap mode. It=20 points to the top level of P2M table, which might be located in memory space=20 beyond 4GB. It can cause problem potentially.</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D508564216-29032007><FONT face=3DArial=20 color=3D#0000ff size=3D2></FONT></SPAN> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D508564216-29032007><FONT face=3DArial=20 color=3D#0000ff size=3D2>-Wei</FONT></SPAN></DIV><BR> <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> Keir Fraser [mailto:keir@xensource.com]=20 <BR><B>Sent:</B> Thursday, March 29, 2007 11:42 AM<BR><B>To:</B> Huang2, Wei;=20 xen-devel@lists.xensource.com; Tim Deegan<BR><B>Subject:</B> Re: [Xen-devel] P2M=20 Top Level Page Table<BR></FONT><BR></DIV> <DIV></DIV><FONT face=3D"Verdana, Helvetica, Arial"><SPAN=20 style=3D"FONT-SIZE: 12px">PAE shadow mode always points CR3 at=20 v->arch.paging.shadow.l3table[], which is guaranteed below 4GB and is a cache=20 of the shadow entries. So it does not matter at all whether the P2M root table=20 is above 4GB.<BR><BR> -- Keir<BR><BR>On 29/3/07 17:05, "Huang2, Wei"=20 <Wei.Huang2@amd.com> wrote:<BR><BR></SPAN></FONT> <BLOCKQUOTE><SPAN style=3D"FONT-SIZE: 12px"><FONT face=3DArial>Current P2M table=20 are allocated through alloc_domheap_pages(), which can potentially allocate=20 memory with physical address > 4G under PAE mode. However, for top level=20 P2M table (under PAE mode), its physical address should be below 4G because=20 CR3 has only 32 bits. I noticed that mm.c relies on pae_l3_cache to solve this=20 problem in make_cr3(). Do we plan to have similar solution for P2M table?=20 Another solution might use xmalloc; but I just wonder whether it always=20 returns memory below 4G. <BR></FONT><FONT=20 face=3D"Verdana, Helvetica, Arial"><BR></FONT><FONT face=3DArial>Any=20 though?<BR></FONT><FONT face=3D"Verdana, Helvetica, Arial"><BR></FONT><FONT=20 face=3DArial>Thanks,<BR></FONT><FONT=20 face=3D"Verdana, Helvetica, Arial"><BR></FONT><FONT=20 face=3DArial>-Wei<BR></FONT><FONT face=3D"Verdana, Helvetica, Arial"><BR> <HR align=3Dcenter width=3D"95%" SIZE=3D3> </FONT></SPAN><FONT size=3D2><FONT face=3D"Monaco, Courier New"><SPAN=20 style=3D"FONT-SIZE: 10px">_______________________________________________<BR>Xen-devel=20 mailing list<BR>Xen-devel@lists.xensource.com<BR><A=20 href=3D"http://lists.xensource.com/xen-devel">http://lists.xensource.com/xen-devel</A><BR></SPAN></FONT></FONT></BLOCKQUOTE><FONT=20 size=3D2><FONT face=3D"Monaco, Courier New"><SPAN=20 style=3D"FONT-SIZE: 10px"><BR></SPAN></FONT></FONT></BODY></HTML> ------_=_NextPart_001_01C77221.D67904C0-- --===============0481690416=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0481690416==-- From xen-devel-bounces.xensource.com Thu Mar 29 18:00:36 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 18:00:36 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWxzH-00058P-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 18:00:35 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:36044 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HWxxc-0007a1-P2 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 17:58:57 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxyN-0002ax-5z; Thu, 29 Mar 2007 16:59:39 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWxxw-0002Ip-J6 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:59:12 +0000 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWxxt-0000zz-V6 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:59:10 +0000 X-Cam-SpamDetails: Not scanned X-Cam-AntiVirus: No virus found Received: from [62.49.66.13] (port=54429 helo=[192.168.14.130]) by ppsw-2.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.152]:587) with esmtpsa (PLAIN:dgm36) (TLSv1:AES128-SHA:128) id 1HWxwj-0005Qs-7G (Exim 4.63) for xen-devel@lists.xensource.com (return-path <dgm36@hermes.cam.ac.uk>); Thu, 29 Mar 2007 17:57:57 +0100 Mime-Version: 1.0 (Apple Message framework v752.3) To: xen-devel@lists.xensource.com Message-Id: <FC472E8A-A837-43A1-91D0-3AA8C2522EA0@cl.cam.ac.uk> Content-Type: multipart/mixed; boundary=Apple-Mail-1--688220714 From: Derek Murray <Derek.Murray@cl.cam.ac.uk> Date: Thu, 29 Mar 2007 17:57:54 +0100 X-Mailer: Apple Mail (2.752.3) X-SA-Exim-Connect-IP: 131.111.8.132 X-SA-Exim-Mail-From: dgm36@hermes.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] [PATCH 2/3] User-space grant table device - main driver - resubmit X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --Apple-Mail-1--688220714 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed I''ve reworked this to take account of the concerns that were raised about synchronisation, and generally cleaned this area up a bit. The other patches remain the same. A character device for accessing (in user-space) pages that have been granted by other domains. Signed-off-by: Derek Murray <Derek.Murray@cl.cam.ac.uk> --Apple-Mail-1--688220714 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=gntdev.patch Content-Disposition: attachment; filename=gntdev.patch diff -r ffb9dda42946 linux-2.6-xen-sparse/drivers/xen/Makefile --- a/linux-2.6-xen-sparse/drivers/xen/Makefile Wed Mar 28 16:52:05 2007 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/Makefile Thu Mar 29 17:53:21 2007 +0100 @@ -3,6 +3,7 @@ obj-y += evtchn/ obj-y += evtchn/ obj-y += privcmd/ obj-y += xenbus/ +obj-y += gntdev/ obj-$(CONFIG_XEN_UTIL) += util.o obj-$(CONFIG_XEN_BALLOON) += balloon/ diff -r ffb9dda42946 linux-2.6-xen-sparse/drivers/xen/gntdev/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/gntdev/Makefile Thu Mar 29 17:53:21 2007 +0100 @@ -0,0 +1,1 @@ +obj-y := gntdev.o diff -r ffb9dda42946 linux-2.6-xen-sparse/drivers/xen/gntdev/gntdev.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/gntdev/gntdev.c Thu Mar 29 17:53:21 2007 +0100 @@ -0,0 +1,993 @@ +/****************************************************************************** + * gntdev.c + * + * Device for accessing (in user-space) pages that have been granted by other + * domains. + * + * Copyright (c) 2006-2007, D G Murray. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU 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 + */ + +#include <asm/atomic.h> +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/fs.h> +#include <linux/device.h> +#include <linux/mm.h> +#include <linux/mman.h> +#include <asm/uaccess.h> +#include <asm/io.h> +#include <xen/gnttab.h> +#include <asm/hypervisor.h> +#include <xen/balloon.h> +#include <xen/evtchn.h> + +#include <linux/types.h> +#include <xen/public/gntdev.h> + + +#define DRIVER_AUTHOR "Derek G. Murray <Derek.Murray@cl.cam.ac.uk>" +#define DRIVER_DESC "User-space granted page access driver" + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); + +#define MAX_GRANTS 128 + +/* A slot can be in one of three states: + * + * 0. GNTDEV_SLOT_INVALID: + * This slot is not associated with a grant reference, and is therefore free + * to be overwritten by a new grant reference. + * + * 1. GNTDEV_SLOT_NOT_YET_MAPPED: + * This slot is associated with a grant reference (via the + * IOCTL_GNTDEV_MAP_GRANT_REF ioctl), but it has not yet been mmap()-ed. + * + * 2. GNTDEV_SLOT_MAPPED: + * This slot is associated with a grant reference, and has been mmap()-ed. + */ +typedef enum gntdev_slot_state { + GNTDEV_SLOT_INVALID = 0, + GNTDEV_SLOT_NOT_YET_MAPPED, + GNTDEV_SLOT_MAPPED +} gntdev_slot_state_t; + +#define GNTDEV_INVALID_HANDLE -1 +#define GNTDEV_FREE_LIST_INVALID -1 +/* Each opened instance of gntdev is associated with a list of grants, + * represented by an array of elements of the following type, + * gntdev_grant_info_t. + */ +typedef struct gntdev_grant_info { + gntdev_slot_state_t state; + union { + uint32_t free_list_index; + struct { + domid_t domid; + grant_ref_t ref; + grant_handle_t kernel_handle; + grant_handle_t user_handle; + uint64_t dev_bus_addr; + } valid; + } u; +} gntdev_grant_info_t; + +/* Private data structure, which is stored in the file pointer for files + * associated with this device. + */ +typedef struct gntdev_file_private_data { + + /* Array of grant information. */ + gntdev_grant_info_t grants[MAX_GRANTS]; + + /* Read/write semaphore used to protect the grants array. */ + struct rw_semaphore grants_sem; + + /* An array of indices of free slots in the grants array. + * N.B. An entry in this list may temporarily have the value + * GNTDEV_FREE_LIST_INVALID if the corresponding slot has been removed + * from the list by the contiguous allocator, but the list has not yet + * been compressed. However, this is not visible across invocations of + * the device. + */ + int32_t free_list[MAX_GRANTS]; + + /* The number of free slots in the grants array. */ + uint32_t free_list_size; + + /* Read/write semaphore used to protect the free list. */ + struct rw_semaphore free_list_sem; + + /* Index of the next slot after the most recent contiguous allocation, + * for use in a next-fit allocator. + */ + uint32_t next_fit_index; + + /* Used to map grants into the kernel, before mapping them into user + * space. + */ + struct page **foreign_pages; + +} gntdev_file_private_data_t; + +/* Module lifecycle operations. */ +static int __init gntdev_init(void); +static void __exit gntdev_exit(void); + +module_init(gntdev_init); +module_exit(gntdev_exit); + +/* File operations. */ +static int gntdev_open(struct inode *inode, struct file *flip); +static int gntdev_release(struct inode *inode, struct file *flip); +static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma); +static int gntdev_ioctl (struct inode *inode, struct file *flip, + unsigned int cmd, unsigned long arg); + +static struct file_operations gntdev_fops = { + .owner = THIS_MODULE, + .open = gntdev_open, + .release = gntdev_release, + .mmap = gntdev_mmap, + .ioctl = gntdev_ioctl +}; + +/* VM operations. */ +static void gntdev_vma_close(struct vm_area_struct *vma); +static pte_t gntdev_clear_pte(struct vm_area_struct *vma, unsigned long addr, + pte_t *ptep, int is_fullmm); + +static struct vm_operations_struct gntdev_vmops = { + .close = gntdev_vma_close, + .ptep_get_and_clear_full = gntdev_clear_pte +}; + +/* Global variables. */ + +/* The driver major number, for use when unregistering the driver. */ +static int gntdev_major; + +#define GNTDEV_NAME "gntdev" + +/* Hacky: refers to the class in blktap implementation. */ +extern struct class *xen_class; + +/* Private functions. */ +static int setup_xen_class(void) +{ + int ret; + + if (xen_class) + return 0; + + xen_class = class_create(THIS_MODULE, "xen"); + if ((ret = IS_ERR(xen_class))) { + xen_class = NULL; + return ret; + } + + return 0; + +} + +/* Memory mapping functions + * ------------------------ + * + * Every granted page is mapped into both kernel and user space, and the two + * following functions return the respective virtual addresses of these pages. + * + * When shadow paging is disabled, the granted page is mapped directly into + * user space; when it is enabled, it is mapped into the kernel and remapped + * into user space using vm_insert_page() (see gntdev_mmap(), below). + */ + +/* Returns the virtual address (in user space) of the @page_index''th page + * in the given VM area. + */ +static inline unsigned long get_user_vaddr (struct vm_area_struct *vma, + int page_index) +{ + return (unsigned long) vma->vm_start + (page_index << PAGE_SHIFT); +} + +/* Returns the virtual address (in kernel space) of the @slot_index''th page + * mapped by the gntdev instance that owns the given private data struct. + */ +static inline unsigned long get_kernel_vaddr (gntdev_file_private_data_t *priv, + int slot_index) +{ + unsigned long pfn; + void *kaddr; + pfn = page_to_pfn(priv->foreign_pages[slot_index]); + kaddr = pfn_to_kaddr(pfn); + return (unsigned long) kaddr; +} + +/* Helper functions. */ + +/* Adds information about a grant reference to the list of grants in the file''s + * private data structure. Returns non-zero on failure. On success, sets the + * value of *offset to the offset that should be mmap()-ed in order to map the + * grant reference. + */ +static int add_grant_reference(struct file *flip, + struct ioctl_gntdev_grant_ref *op, + long *offset) +{ + gntdev_file_private_data_t *private_data + = (gntdev_file_private_data_t *) flip->private_data; + + uint32_t slot_index; + + if (unlikely(private_data->free_list_size == 0)) { + return -ENOMEM; + } + + slot_index = private_data->free_list[--private_data->free_list_size]; + + /* Copy the grant information into file''s private data. */ + private_data->grants[slot_index].state = GNTDEV_SLOT_NOT_YET_MAPPED; + private_data->grants[slot_index].u.valid.domid = op->domid; + private_data->grants[slot_index].u.valid.ref = op->ref; + + /* The offset is calculated as the index of the chosen entry in the + * file''s private data''s array of grant information. This is then + * shifted to give an offset into the virtual "file address space". + */ + *offset = slot_index << PAGE_SHIFT; + + return 0; +} + +/* Adds the @count grant references to the contiguous range in the slot array + * beginning at @first_slot. It is assumed that @first_slot was returned by a + * previous invocation of find_contiguous_free_range(), during the same + * invocation of the driver. + */ +static int add_grant_references(struct file *flip, + int count, + struct ioctl_gntdev_grant_ref *ops, + uint32_t first_slot) +{ + gntdev_file_private_data_t *private_data + = (gntdev_file_private_data_t *) flip->private_data; + int i; + + for (i = 0; i < count; ++i) { + + /* First, mark the slot''s entry in the free list as invalid. */ + int free_list_index = + private_data->grants[first_slot+i].u.free_list_index; + private_data->free_list[free_list_index] = + GNTDEV_FREE_LIST_INVALID; + + /* Now, update the slot. */ + private_data->grants[first_slot+i].state = + GNTDEV_SLOT_NOT_YET_MAPPED; + private_data->grants[first_slot+i].u.valid.domid = ops[i].domid; + private_data->grants[first_slot+i].u.valid.ref = ops[i].ref; + } + + return 0; +} + +/* Scans through the free list for @flip, removing entries that are marked as + * GNTDEV_SLOT_INVALID. This will reduce the recorded size of the free list to + * the number of valid entries. + */ +static void compress_free_list(struct file *flip) +{ + gntdev_file_private_data_t *private_data + = (gntdev_file_private_data_t *) flip->private_data; + int i, j = 0, old_size; + + old_size = private_data->free_list_size; + for (i = 0; i < old_size; ++i) { + if (private_data->free_list[i] != GNTDEV_FREE_LIST_INVALID) { + private_data->free_list[j] = + private_data->free_list[i]; + ++j; + } else { + --private_data->free_list_size; + } + } +} + +/* Searches the grant array in the private data of @flip for a range of + * @num_slots contiguous slots in the GNTDEV_SLOT_INVALID state. + * + * Returns the index of the first slot if a range is found, otherwise -ENOMEM. + */ +static int find_contiguous_free_range(struct file *flip, + uint32_t num_slots) +{ + gntdev_file_private_data_t *private_data + = (gntdev_file_private_data_t *) flip->private_data; + + int i; + int start_index = private_data->next_fit_index; + int range_start = 0, range_length; + + if (private_data->free_list_size < num_slots) { + return -ENOMEM; + } + + /* First search from the start_index to the end of the array. */ + range_length = 0; + for (i = start_index; i < MAX_GRANTS; ++i) { + if (private_data->grants[i].state == GNTDEV_SLOT_INVALID) { + if (range_length == 0) { + range_start = i; + } + ++range_length; + if (range_length == num_slots) { + return range_start; + } + } + } + + /* Now search from the start of the array to the start_index. */ + range_length = 0; + for (i = 0; i < start_index; ++i) { + if (private_data->grants[i].state == GNTDEV_SLOT_INVALID) { + if (range_length == 0) { + range_start = i; + } + ++range_length; + if (range_length == num_slots) { + return range_start; + } + } + } + + return -ENOMEM; +} + +/* Interface functions. */ + +/* Initialises the driver. Called when the module is loaded. */ +static int __init gntdev_init(void) +{ + struct class_device *device; + + if (!is_running_on_xen()) { + printk(KERN_ERR "You must be running Xen to use gntdev\n"); + return -ENODEV; + } + + gntdev_major = register_chrdev(0, GNTDEV_NAME, &gntdev_fops); + if (gntdev_major < 0) + { + printk(KERN_ERR "Could not register gntdev device\n"); + return -ENOMEM; + } + + /* Note that if the sysfs code fails, we will still initialise the + * device, and output the major number so that the device can be + * created manually using mknod. + */ + if (setup_xen_class()) { + printk(KERN_ERR "Error setting up xen_class\n"); + printk(KERN_ERR "gntdev created with major number = %d\n", + gntdev_major); + return 0; + } + + device = class_device_create(xen_class, NULL, MKDEV(gntdev_major, 0), + NULL, GNTDEV_NAME); + if (IS_ERR(device)) { + printk(KERN_ERR "Error creating gntdev device in xen_class\n"); + printk(KERN_ERR "gntdev created with major number = %d\n", + gntdev_major); + return 0; + } + + return 0; +} + +/* Cleans up and unregisters the driver. Called when the driver is unloaded. + */ +static void __exit gntdev_exit(void) +{ + class_device_destroy(xen_class, MKDEV(gntdev_major, 0)); + unregister_chrdev(gntdev_major, GNTDEV_NAME); +} + +/* Called when the device is opened. + */ +static int gntdev_open(struct inode *inode, struct file *flip) +{ + gntdev_file_private_data_t *private_data; + int i; + + try_module_get(THIS_MODULE); + + /* Allocate space for the per-instance private data. */ + private_data = kmalloc(sizeof(*private_data), GFP_KERNEL); + if (!private_data) + goto nomem_out; + + /* Allocate space for the kernel-mapping of granted pages. */ + private_data->foreign_pages = + alloc_empty_pages_and_pagevec(MAX_GRANTS); + if (!private_data->foreign_pages) + goto nomem_out2; + + /* Initialise the free-list, which contains all slots at first. + */ + for (i = 0; i < MAX_GRANTS; ++i) { + private_data->free_list[MAX_GRANTS - i - 1] = i; + private_data->grants[i].state = GNTDEV_SLOT_INVALID; + private_data->grants[i].u.free_list_index = MAX_GRANTS - i - 1; + } + private_data->free_list_size = MAX_GRANTS; + private_data->next_fit_index = 0; + + init_rwsem(&private_data->grants_sem); + init_rwsem(&private_data->free_list_sem); + + flip->private_data = private_data; + + return 0; + +nomem_out2: + kfree(private_data); +nomem_out: + return -ENOMEM; +} + +/* Called when the device is closed. + */ +static int gntdev_release(struct inode *inode, struct file *flip) +{ + if (flip->private_data) { + gntdev_file_private_data_t *private_data = + (gntdev_file_private_data_t *) flip->private_data; + if (private_data->foreign_pages) { + free_empty_pages_and_pagevec + (private_data->foreign_pages, MAX_GRANTS); + } + kfree(private_data); + } + module_put(THIS_MODULE); + return 0; +} + +/* Called when an attempt is made to mmap() the device. The private data from + * @flip contains the list of grant references that can be mapped. The vm_pgoff + * field of @vma contains the index into that list that refers to the grant + * reference that will be mapped. Only mappings that are a multiple of + * PAGE_SIZE are handled. + */ +static int gntdev_mmap (struct file *flip, struct vm_area_struct *vma) +{ + struct gnttab_map_grant_ref op; + unsigned long slot_index = vma->vm_pgoff; + unsigned long kernel_vaddr, user_vaddr; + uint32_t size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + uint64_t ptep; + int ret; + int flags; + int i; + struct page *page; + gntdev_file_private_data_t *private_data = flip->private_data; + + if (unlikely(!private_data)) { + printk(KERN_ERR "File''s private data is NULL.\n"); + return -EINVAL; + } + + if (unlikely((size <= 0) || (size + slot_index) > MAX_GRANTS)) { + printk(KERN_ERR "Invalid number of pages or offset" + "(num_pages = %d, first_slot = %ld).\n", + size, slot_index); + return -ENXIO; + } + + if ((vma->vm_flags & VM_WRITE) && !(vma->vm_flags & VM_SHARED)) { + printk(KERN_ERR "Writable mappings must be shared.\n"); + return -EINVAL; + } + + /* Slots must be in the NOT_YET_MAPPED state. */ + down_write(&private_data->grants_sem); + for (i = 0; i < size; ++i) { + if (private_data->grants[slot_index + i].state != + GNTDEV_SLOT_NOT_YET_MAPPED) { + printk(KERN_ERR "Slot (index = %ld) is in the wrong " + "state (%d).\n", slot_index + i, + private_data->grants[slot_index + i].state); + up_write(&private_data->grants_sem); + return -EINVAL; + } + } + + /* Install the hook for unmapping. */ + vma->vm_ops = &gntdev_vmops; + + /* The VM area contains pages from another VM. */ + vma->vm_flags |= VM_FOREIGN; + vma->vm_private_data = kzalloc(size * sizeof(struct page_struct *), + GFP_KERNEL); + if (vma->vm_private_data == NULL) { + printk(KERN_ERR "Couldn''t allocate mapping structure for VM " + "area.\n"); + return -ENOMEM; + } + + /* This flag prevents Bad PTE errors when the memory is unmapped. */ + vma->vm_flags |= VM_RESERVED; + + /* This flag prevents this VM area being copied on a fork(). A better + * behaviour might be to explicitly carry out the appropriate mappings + * on fork(), but I don''t know if there''s a hook for this. + */ + vma->vm_flags |= VM_DONTCOPY; + + /* This flag ensures that the page tables are not unpinned before the + * VM area is unmapped. Therefore Xen still recognises the PTE as + * belonging to an L1 pagetable, and the grant unmap operation will + * succeed, even if the process does not exit cleanly. + */ + vma->vm_mm->context.has_foreign_mappings = 1; + + for (i = 0; i < size; ++i) { + + flags = GNTMAP_host_map; + if (!(vma->vm_flags & VM_WRITE)) + flags |= GNTMAP_readonly; + + kernel_vaddr = get_kernel_vaddr(private_data, slot_index + i); + user_vaddr = get_user_vaddr(vma, i); + page = pfn_to_page(__pa(kernel_vaddr) >> PAGE_SHIFT); + + gnttab_set_map_op(&op, kernel_vaddr, flags, + private_data->grants[slot_index+i] + .u.valid.ref, + private_data->grants[slot_index+i] + .u.valid.domid); + + /* Carry out the mapping of the grant reference. */ + ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, + &op, 1); + BUG_ON(ret); + if (op.status) { + printk(KERN_ERR "Error mapping the grant reference " + "into the kernel (%d). domid = %d; ref = %d\n", + op.status, + private_data->grants[slot_index+i] + .u.valid.domid, + private_data->grants[slot_index+i] + .u.valid.ref); + goto undo_map_out; + } + + /* Store a reference to the page that will be mapped into user + * space. + */ + ((struct page **) vma->vm_private_data)[i] = page; + + /* Mark mapped page as reserved. */ + SetPageReserved(page); + + /* Record the grant handle, for use in the unmap operation. */ + private_data->grants[slot_index+i].u.valid.kernel_handle = + op.handle; + private_data->grants[slot_index+i].u.valid.dev_bus_addr = + op.dev_bus_addr; + + private_data->grants[slot_index+i].state = GNTDEV_SLOT_MAPPED; + private_data->grants[slot_index+i].u.valid.user_handle + GNTDEV_INVALID_HANDLE; + + /* Now perform the mapping to user space. */ + if (!xen_feature(XENFEAT_auto_translated_physmap)) { + + /* NOT USING SHADOW PAGE TABLES. */ + /* In this case, we map the grant(s) straight into user + * space. + */ + + /* Get the machine address of the PTE for the user + * page. + */ + if ((ret = create_lookup_pte_addr(vma->vm_mm, + vma->vm_start + + (i << PAGE_SHIFT), + &ptep))) + { + printk(KERN_ERR "Error obtaining PTE pointer " + "(%d).\n", ret); + goto undo_map_out; + } + + /* Configure the map operation. */ + + /* The reference is to be used by host CPUs. */ + flags = GNTMAP_host_map; + + /* Specifies a user space mapping. */ + flags |= GNTMAP_application_map; + + /* The map request contains the machine address of the + * PTE to update. + */ + flags |= GNTMAP_contains_pte; + + if (!(vma->vm_flags & VM_WRITE)) + flags |= GNTMAP_readonly; + + gnttab_set_map_op(&op, ptep, flags, + private_data->grants[slot_index+i] + .u.valid.ref, + private_data->grants[slot_index+i] + .u.valid.domid); + + /* Carry out the mapping of the grant reference. */ + ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, + &op, 1); + BUG_ON(ret); + if (op.status) { + printk(KERN_ERR "Error mapping the grant " + "reference into user space (%d). domid " + "= %d; ref = %d\n", op.status, + private_data->grants[slot_index+i].u + .valid.domid, + private_data->grants[slot_index+i].u + .valid.ref); + goto undo_map_out; + } + + /* Record the grant handle, for use in the unmap + * operation. + */ + private_data->grants[slot_index+i].u.valid.user_handle + op.handle; + + /* Update p2m structure with the new mapping. */ + set_phys_to_machine(__pa(kernel_vaddr) >> PAGE_SHIFT, + FOREIGN_FRAME(private_data-> + grants[slot_index+i] + .u.valid.dev_bus_addr + >> PAGE_SHIFT)); + } else { + /* USING SHADOW PAGE TABLES. */ + /* In this case, we simply insert the page into the VM + * area. */ + ret = vm_insert_page(vma, user_vaddr, page); + } + + } + + up_write(&private_data->grants_sem); + return 0; + +undo_map_out: + /* If we have a mapping failure, the unmapping will be taken care of + * by do_mmap_pgoff(), which will eventually call gntdev_clear_pte(). + * All we need to do here is free the vma_private_data. + */ + kfree(vma->vm_private_data); + + /* THIS IS VERY UNPLEASANT: do_mmap_pgoff() will set the vma->vm_file + * to NULL on failure. However, we need this in gntdev_clear_pte() to + * unmap the grants. Therefore, we smuggle a reference to the file''s + * private data in the VM area''s private data pointer. + */ + vma->vm_private_data = private_data; + + up_write(&private_data->grants_sem); + + return -ENOMEM; +} + +static pte_t gntdev_clear_pte(struct vm_area_struct *vma, unsigned long addr, + pte_t *ptep, int is_fullmm) +{ + int slot_index, ret; + pte_t copy; + struct gnttab_unmap_grant_ref op; + gntdev_file_private_data_t *private_data; + + /* THIS IS VERY UNPLEASANT: do_mmap_pgoff() will set the vma->vm_file + * to NULL on failure. However, we need this in gntdev_clear_pte() to + * unmap the grants. Therefore, we smuggle a reference to the file''s + * private data in the VM area''s private data pointer. + */ + if (vma->vm_file) { + private_data = (gntdev_file_private_data_t *) + vma->vm_file->private_data; + } else if (vma->vm_private_data) { + private_data = (gntdev_file_private_data_t *) + vma->vm_private_data; + } else { + BUG(); + } + + /* Copy the existing value of the PTE for returning. */ + copy = *ptep; + + /* Calculate the grant relating to this PTE. */ + slot_index = vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT); + + /* Only unmap grants if the slot has been mapped. This could be being + * called from a failing mmap(). + */ + if (private_data->grants[slot_index].state == GNTDEV_SLOT_MAPPED) { + + /* First, we clear the user space mapping, if it has been made. + */ + if (private_data->grants[slot_index].u.valid.user_handle !+ GNTDEV_INVALID_HANDLE && + !xen_feature(XENFEAT_auto_translated_physmap)) { + /* NOT USING SHADOW PAGE TABLES. */ + gnttab_set_unmap_op(&op, virt_to_machine(ptep), + GNTMAP_contains_pte, + private_data->grants[slot_index] + .u.valid.user_handle); + ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, + &op, 1); + BUG_ON(ret); + if (op.status) + printk("User unmap grant status = %d\n", + op.status); + } else { + /* USING SHADOW PAGE TABLES. */ + pte_clear_full(vma->vm_mm, addr, ptep, is_fullmm); + } + + /* Finally, we unmap the grant from kernel space. */ + gnttab_set_unmap_op(&op, + get_kernel_vaddr(private_data, slot_index), + GNTMAP_host_map, + private_data->grants[slot_index].u.valid + .kernel_handle); + ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, + &op, 1); + BUG_ON(ret); + if (op.status) + printk("Kernel unmap grant status = %d\n", op.status); + + + /* Return slot to the not-yet-mapped state, so that it may be + * mapped again, or removed by a subsequent ioctl. + */ + private_data->grants[slot_index].state = + GNTDEV_SLOT_NOT_YET_MAPPED; + + /* Invalidate the physical to machine mapping for this page. */ + set_phys_to_machine(__pa(get_kernel_vaddr(private_data, + slot_index)) + >> PAGE_SHIFT, INVALID_P2M_ENTRY); + + } else { + pte_clear_full(vma->vm_mm, addr, ptep, is_fullmm); + } + + return copy; +} + +/* "Destructor" for a VM area. + */ +static void gntdev_vma_close(struct vm_area_struct *vma) { + if (vma->vm_private_data) { + kfree(vma->vm_private_data); + } +} + +/* Called when an ioctl is made on the device. + */ +static int gntdev_ioctl(struct inode *inode, struct file *flip, + unsigned int cmd, unsigned long arg) +{ + int rc = 0; + gntdev_file_private_data_t *private_data = + (gntdev_file_private_data_t *) flip->private_data; + + switch (cmd) { + case IOCTL_GNTDEV_MAP_GRANT_REF: + { + struct ioctl_gntdev_map_grant_ref op; + down_write(&private_data->grants_sem); + down_write(&private_data->free_list_sem); + + if ((rc = copy_from_user(&op, (void __user *) arg, + sizeof(op)))) { + rc = -EFAULT; + goto map_out; + } + if (unlikely(op.count <= 0)) { + rc = -EINVAL; + goto map_out; + } + + if (op.count == 1) { + struct ioctl_gntdev_grant_ref ref; + if ((rc = copy_from_user(&ref, + (void __user *) op.refs, + sizeof(op)))) { + printk(KERN_ERR "Copying ref from user failed " + "(%d).\n", rc); + rc = -EINVAL; + goto map_out; + } + if ((rc = add_grant_reference(flip, &ref, &op.index)) + < 0) { + printk(KERN_ERR "Adding grant reference " + "failed (%d).\n", rc); + goto map_out; + } + } else { + struct ioctl_gntdev_grant_ref *refs + kmalloc(op.count * sizeof(*refs), GFP_KERNEL); + if (!refs) { + rc = -ENOMEM; + goto map_out; + } + if ((rc = copy_from_user(refs, + (void __user *) op.refs, + sizeof(*refs) * op.count))) { + printk(KERN_ERR "Copying refs from user failed" + " (%d).\n", rc); + rc = -EINVAL; + goto map_out; + } + if ((rc = find_contiguous_free_range(flip, op.count)) + < 0) { + printk(KERN_ERR "Finding contiguous range " + "failed (%d).\n", rc); + kfree(refs); + goto map_out; + } + op.index = rc << PAGE_SHIFT; + if ((rc = add_grant_references(flip, op.count, + refs, rc))) { + printk(KERN_ERR "Adding grant references " + "failed (%d).\n", rc); + kfree(refs); + goto map_out; + } + compress_free_list(flip); + kfree(refs); + } + if ((rc = copy_to_user((void __user *) arg, + &op, + sizeof(op)))) { + printk(KERN_ERR "Copying result back to user failed " + "(%d)\n", rc); + rc = -EFAULT; + goto map_out; + } + map_out: + up_write(&private_data->grants_sem); + up_write(&private_data->free_list_sem); + return rc; + } + case IOCTL_GNTDEV_UNMAP_GRANT_REF: + { + struct ioctl_gntdev_unmap_grant_ref op; + int i, start_index; + + down_write(&private_data->grants_sem); + down_write(&private_data->free_list_sem); + + if ((rc = copy_from_user(&op, + (void __user *) arg, + sizeof(op)))) { + rc = -EFAULT; + goto unmap_out; + } + + start_index = op.index >> PAGE_SHIFT; + + /* First, check that all pages are in the NOT_YET_MAPPED + * state. + */ + for (i = 0; i < op.count; ++i) { + if (unlikely + (private_data->grants[start_index + i].state + != GNTDEV_SLOT_NOT_YET_MAPPED)) { + if (private_data->grants[start_index + i].state + == GNTDEV_SLOT_INVALID) { + printk(KERN_ERR + "Tried to remove an invalid " + "grant at offset 0x%x.", + (start_index + i) + << PAGE_SHIFT); + rc = -EINVAL; + } else { + printk(KERN_ERR + "Tried to remove a grant which " + "is currently mmap()-ed at " + "offset 0x%x.", + (start_index + i) + << PAGE_SHIFT); + rc = -EBUSY; + } + goto unmap_out; + } + } + + /* Unmap pages and add them to the free list. + */ + for (i = 0; i < op.count; ++i) { + private_data->grants[start_index+i].state = + GNTDEV_SLOT_INVALID; + private_data->grants[start_index+i].u.free_list_index + private_data->free_list_size; + private_data->free_list[private_data->free_list_size] + start_index + i; + ++private_data->free_list_size; + } + compress_free_list(flip); + + unmap_out: + up_write(&private_data->grants_sem); + up_write(&private_data->free_list_sem); + return rc; + } + case IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR: + { + struct ioctl_gntdev_get_offset_for_vaddr op; + struct vm_area_struct *vma; + + if ((rc = copy_from_user(&op, + (void __user *) arg, + sizeof(op)))) { + rc = -EFAULT; + goto get_offset_out; + } + down_read(¤t->mm->mmap_sem); + vma = find_vma(current->mm, (unsigned long) op.vaddr); + if (vma == NULL) { + rc = -EFAULT; + goto get_offset_unlock_out; + } + if ((!vma->vm_ops) || (vma->vm_ops != &gntdev_vmops)) { + printk(KERN_ERR "The vaddr specified does not belong " + "to a gntdev instance: %#lx\n", + (unsigned long) op.vaddr); + rc = -EFAULT; + goto get_offset_unlock_out; + } + if (vma->vm_start != (unsigned long) op.vaddr) { + printk(KERN_ERR "The vaddr specified in an " + "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR must be at " + "the start of the VM area. vma->vm_start = " + "%#lx; vaddr = %#lx\n", + vma->vm_start, (unsigned long) op.vaddr); + rc = -EFAULT; + goto get_offset_unlock_out; + } + op.offset = vma->vm_pgoff << PAGE_SHIFT; + op.count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + up_read(¤t->mm->mmap_sem); + if ((rc = copy_to_user((void __user *) arg, + &op, + sizeof(op)))) { + rc = -EFAULT; + goto get_offset_out; + } + goto get_offset_out; + get_offset_unlock_out: + up_read(¤t->mm->mmap_sem); + get_offset_out: + return rc; + } + default: + return -ENOIOCTLCMD; + } + + return 0; +} diff -r ffb9dda42946 linux-2.6-xen-sparse/include/xen/public/gntdev.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-2.6-xen-sparse/include/xen/public/gntdev.h Thu Mar 29 17:53:21 2007 +0100 @@ -0,0 +1,101 @@ +/****************************************************************************** + * gntdev.h + * + * Interface to /dev/xen/gntdev. + * + * Copyright (c) 2007, D G Murray + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation; or, when distributed + * separately from the Linux kernel or incorporated into other + * software packages, subject to the following license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this source file (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __LINUX_PUBLIC_GNTDEV_H__ +#define __LINUX_PUBLIC_GNTDEV_H__ + +struct ioctl_gntdev_grant_ref { + /* The domain ID of the grant to be mapped. */ + uint32_t domid; + /* The grant reference of the grant to be mapped. */ + uint32_t ref; +}; + +/* + * Inserts the grant references into the mapping table of an instance + * of gntdev. N.B. This does not perform the mapping, which is deferred + * until mmap() is called with @index as the offset. + */ +#define IOCTL_GNTDEV_MAP_GRANT_REF \ +_IOC(_IOC_NONE, ''G'', 0, sizeof(struct ioctl_gntdev_map_grant_ref)) +struct ioctl_gntdev_map_grant_ref { + /* IN parameters */ + /* The number of grants to be mapped. */ + uint32_t count; + /* Pointer to an array of grant references, of size @count. */ + struct ioctl_gntdev_grant_ref *refs; + /* OUT parameters */ + /* The offset to be used on a subsequent call to mmap(). */ + long index; +}; + +/* + * Removes the grant references from the mapping table of an instance of + * of gntdev. N.B. munmap() must be called on the relevant virtual address(es) + * before this ioctl is called, or an error will result. + */ +#define IOCTL_GNTDEV_UNMAP_GRANT_REF \ +_IOC(_IOC_NONE, ''G'', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref)) +struct ioctl_gntdev_unmap_grant_ref { + /* IN parameters */ + /* The offset was returned by the corresponding map operation. */ + long index; + /* The number of pages to be unmapped. */ + uint32_t count; +}; + +/* + * Returns the offset in the driver''s address space that corresponds + * to @vaddr. This can be used to perform a munmap(), followed by an + * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by + * the caller. The number of pages that were allocated at the same time as + * @vaddr is returned in @count. + * + * N.B. Where more than one page has been mapped into a contiguous range, the + * supplied @vaddr must correspond to the start of the range; otherwise + * an error will result. It is only possible to munmap() the entire + * contiguously-allocated range at once, and not any subrange thereof. + */ +#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \ +_IOC(_IOC_NONE, ''G'', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr)) +struct ioctl_gntdev_get_offset_for_vaddr { + /* IN parameters */ + /* The virtual address of the first mapped page in a range. */ + void *vaddr; + /* OUT parameters */ + /* The offset that was used in the initial mmap() operation. */ + long offset; + /* The number of pages mapped in the VM area that begins at @vaddr. */ + uint32_t count; +}; + +#endif /* __LINUX_PUBLIC_GNTDEV_H__ */ --Apple-Mail-1--688220714 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Apple-Mail-1--688220714-- From xen-devel-bounces.xensource.com Thu Mar 29 18:15:47 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 18:15:47 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWyDz-0005LM-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 18:15:47 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:44920 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HWyCz-0006Bz-W4 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 18:14:51 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyDi-00037L-Fn; Thu, 29 Mar 2007 17:15:30 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyDK-0002pY-0D for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:15:06 +0000 Received: from outbound-blu.frontbridge.com ([65.55.251.16] helo=outbound6-blu-R.bigfish.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWyDF-00012H-8e for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:15:03 +0000 Received: from outbound6-blu.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound6-blu-R.bigfish.com (Postfix) with ESMTP id 9F43510899BA for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 17:13:50 +0000 (UTC) Received: from mail73-blu-R.bigfish.com (unknown [10.1.252.3]) by outbound6-blu.bigfish.com (Postfix) with ESMTP id 8EF63BE8062 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 17:13:50 +0000 (UTC) Received: from mail73-blu (localhost.localdomain [127.0.0.1]) by mail73-blu-R.bigfish.com (Postfix) with ESMTP id 6F08A9980E2 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 17:13:50 +0000 (UTC) X-BigFish: VP Received: by mail73-blu (MessageSwitch) id 1175188430253178_16402; Thu, 29 Mar 2007 17:13:50 +0000 (UCT) Received: from svlb1extmailp01.amd.com (unknown [139.95.251.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail73-blu.bigfish.com (Postfix) with ESMTP id 6A7A313C00B4 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 17:13:46 +0000 (UTC) Received: from SSVLGW01.amd.com (ssvlgw01.amd.com [139.95.250.169]) by svlb1extmailp01.amd.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2THCebH011176 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 10:13:41 -0700 Received: from 139.95.53.183 by SSVLGW01.amd.com with ESMTP (AMD SMTP Relay (Email Firewall v6.1.0)); Thu, 29 Mar 2007 09:13:35 -0800 X-Server-Uuid: 89466532-923C-4A88-82C1-66ACAA0041DF Received: from ssvlexmb2.amd.com ([139.95.53.7]) by SSVLEXBH2.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 10:13:35 -0700 Received: from SF30EXMB1.amd.com ([172.20.6.49]) by ssvlexmb2.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 10:13:34 -0700 Received: from sefsexmb1.amd.com ([165.204.82.123]) by SF30EXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Thu, 29 Mar 2007 19:13:29 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 29 Mar 2007 19:13:05 +0200 Message-ID: <907625E08839C4409CE5768403633E0B018E1B52@sefsexmb1.amd.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: APIC initialization when config file has "apic=0". Thread-Index: AcdyJYQIV4X9azsRTli55zwoSm/8hQ=From: "Petersson, Mats" <Mats.Petersson@amd.com> To: xen-devel@lists.xensource.com X-OriginalArrivalTime: 29 Mar 2007 17:13:29.0892 (UTC) FILETIME=[9266DE40:01C77225] X-WSS-ID: 6A152C352EG4106364-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 65.55.251.16 X-SA-Exim-Mail-From: Mats.Petersson@amd.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] APIC initialization when config file has "apic=0". X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com I''ve been working (as a side-project) on a problem with "no interrupts" I''m seeing with some "simple guests"[1].=20 To me, if config file has "apic=3D0", the APIC should not stop the guest from being able to use the 8259 as an interrupt source. But this appears to be the case - and as far as I can see, it''s because the APIC mode is not initialized (correctly/at all) when the guest is started.=20 Shouldn''t "apic=3D0" mean that the guest appears like there''s no APIC? In which case, this should mean that the IA32_APIC_BASE MSR should have the APIC disable bit set.=20 If my above statement is correct, how can the hvm-code get the value of the APIC from the domain creation script (or command line)? [1] A simple guest is essentially a replacement for "hvmloader" that is loaded into memory and starts executing whatever you filled the executable with.=20 -- Mats _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 18:41:22 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 18:41:22 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWyck-0003Fz-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 18:41:22 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.254, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:52505 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWycK-0003ev-8I (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 18:41:01 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyd3-0003Yx-KH; Thu, 29 Mar 2007 17:41:41 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWycU-0003H3-NU for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:41:06 +0000 Received: from 207.47.60.4.static.nextweb.net ([207.47.60.4] helo=rpc.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWycS-0001EU-7b for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:41:04 +0000 Received: from 217.46.209.99 ([217.46.209.99]) by exchpamain.ad.xensource.com ([192.168.3.25]) via Exchange Front-End Server rpc.xensource.com ([192.168.3.26]) with Microsoft Exchange Server HTTP-DAV ; Thu, 29 Mar 2007 17:39:53 +0000 User-Agent: Microsoft-Entourage/11.2.5.060620 Date: Thu, 29 Mar 2007 18:39:41 +0100 From: Keir Fraser <keir@xensource.com> To: "Huang2, Wei" <Wei.Huang2@amd.com>, Keir Fraser <keir@xensource.com>, <xen-devel@lists.xensource.com>, Tim Deegan <Tim.Deegan@xensource.com> Message-ID: <C231B86D.C8B5%keir@xensource.com> Thread-Topic: [Xen-devel] P2M Top Level Page Table Thread-Index: AcdyHBl6ROin1Ah6Tnm0i91fEIxX9gABQ2wVAAAJnUAAAftPBw=In-Reply-To: <7D748C767B7FA541A8AC5504A4C89A23015685FF@SAUSEXMB2.amd.com> Mime-version: 1.0 X-SA-Exim-Connect-IP: 207.47.60.4 X-SA-Exim-Mail-From: Keir.Fraser@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,HTML_40_50,HTML_MESSAGE,RCVD_NUMERIC_HELO autolearn=no version=3.1.0 Subject: Re: [Xen-devel] P2M Top Level Page Table X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0636044614==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com> This message is in MIME format. Since your mail reader does not understandthis format, some or all of this message may not be legible. --===============0636044614=Content-type: multipart/alternative; boundary="B_3258038381_66371366"> This message is in MIME format. Since your mail reader does not understandthis format, some or all of this message may not be legible. --B_3258038381_66371366 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable On 29/3/07 17:46, "Huang2, Wei" <Wei.Huang2@amd.com> wrote:> My question is about h_cr3 in VMCB under hap mode. It points to the top level > of P2M table, which might be located in memory space beyond 4GB. It can cause > problem potentially.Sounds like you=B9ll need to fix it then. =3D) There are several =8Clowmem pae top-level caches=B9 tucked away in vcpu->arch, so you could reuse one of those. Or allocate/reallocate the P2M root using alloc_domheap_pages with a limited address mask, or use xmalloc. -- Keir --B_3258038381_66371366 Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable <HTML> <HEAD> <TITLE>Re: [Xen-devel] P2M Top Level Page Table</TITLE> </HEAD> <BODY> <FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYLE=3D''font-size:12.0px''>On 29/3/07 17:46, "Huang2, Wei" <Wei.Huang2@amd.com> wrote:<BR> <BR> </SPAN></FONT><BLOCKQUOTE><SPAN STYLE=3D''font-size:12.0px''><FONT COLOR=3D"#0000FF"><FONT FACE=3D"Arial">My question is about h_cr3 in VMCB under hap mode. It points to the top level of P2M table, which might be located in memory space beyond 4GB. It can cause problem potentially.<BR> </FONT></FONT></SPAN></BLOCKQUOTE><SPAN STYLE=3D''font-size:12.0px''><FONT COLOR=3D"#0000FF"><FONT FACE=3D"Arial"><BR> </FONT></FONT><FONT FACE=3D"Arial">Sounds like you’ll need to fix it then. =3D)<BR> <BR> There are several ‘lowmem pae top-level caches’ tucked away in vcpu->arch, so you could reuse one of those. Or allocate/reallocate the P2M root using alloc_domheap_pages with a limited address mask, or use xmalloc.<BR> <BR> -- Keir<BR> </FONT></SPAN> </BODY> </HTML> --B_3258038381_66371366-- --===============0636044614=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0636044614==-- From xen-devel-bounces.xensource.com Thu Mar 29 18:48:00 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 18:48:00 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWyj9-0003RN-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 18:47:59 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:58521 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWyip-0000B0-8M (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 18:47:44 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyja-0004bE-Qw; Thu, 29 Mar 2007 17:48:26 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyjC-0004JB-EW for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:48:02 +0000 Received: from mga02.intel.com ([134.134.136.20]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWyj9-0001G6-Dg for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:48:00 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 29 Mar 2007 10:46:48 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2007 10:46:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,347,1170662400"; d="scan''208"; a="218700713:sNHT26833821" Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 10:46:47 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C7722A.37AA4F72" Date: Fri, 30 Mar 2007 01:46:43 +0800 Message-ID: <B30DA1341B0CFA4893EF8A36B40B5C5DF224D4@pdsmsx411.ccr.corp.intel.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH] Enable VMX MSR bitmap support Thread-Index: AcdyKjZ/7APHhrjjQt+EbbWJ0G+Nwg=From: "Li, Xin B" <xin.b.li@intel.com> To: <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 29 Mar 2007 17:46:47.0958 (UTC) FILETIME=[39578B60:01C7722A] X-SA-Exim-Connect-IP: 134.134.136.20 X-SA-Exim-Mail-From: xin.b.li@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] [PATCH] Enable VMX MSR bitmap support X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. ------_=_NextPart_001_01C7722A.37AA4F72 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable We use it to avoid VMExits on FS_BASE and GS_BASE MSR accesses. Signed-off-by: Weidong Han <weidong.han@intel.com> Signed-off-by: Xin Li <xin.b.li@intel.com> ------_=_NextPart_001_01C7722A.37AA4F72 Content-Type: application/octet-stream; name="vmx_msr_bitmap.patch" Content-Transfer-Encoding: base64 Content-Description: vmx_msr_bitmap.patch Content-Disposition: attachment; filename="vmx_msr_bitmap.patch" ZGlmZiAtciA3MDQxNTFkMGUyMTkgbGludXgtMi42LXhlbi1zcGFyc2UvaW5jbHVkZS9hc20teDg2 XzY0L21hY2gteGVuL2FzbS9tc3IuaAotLS0gYS9saW51eC0yLjYteGVuLXNwYXJzZS9pbmNsdWRl L2FzbS14ODZfNjQvbWFjaC14ZW4vYXNtL21zci5oCVRodSBNYXIgMjkgMTg6MjY6MTIgMjAwNyAr MDEwMAorKysgYi9saW51eC0yLjYteGVuLXNwYXJzZS9pbmNsdWRlL2FzbS14ODZfNjQvbWFjaC14 ZW4vYXNtL21zci5oCVRodSBNYXIgMjkgMTM6MTU6NTQgMjAwNyArMDgwMApAQCAtMTU4LDggKzE1 OCw4IEBAIHN0YXRpYyBpbmxpbmUgdW5zaWduZWQgaW50IGNwdWlkX2VkeCh1bnMKICNkZWZpbmUg TVNSX0xTVEFSIDB4YzAwMDAwODIgCQkvKiBsb25nIG1vZGUgU1lTQ0FMTCB0YXJnZXQgKi8KICNk ZWZpbmUgTVNSX0NTVEFSIDB4YzAwMDAwODMJCS8qIGNvbXBhdGliaWxpdHkgbW9kZSBTWVNDQUxM IHRhcmdldCAqLwogI2RlZmluZSBNU1JfU1lTQ0FMTF9NQVNLIDB4YzAwMDAwODQJLyogRUZMQUdT IG1hc2sgZm9yIHN5c2NhbGwgKi8KLSNkZWZpbmUgTVNSX0ZTX0JBU0UgMHhjMDAwMDEwMAkJLyog NjRiaXQgR1MgYmFzZSAqLwotI2RlZmluZSBNU1JfR1NfQkFTRSAweGMwMDAwMTAxCQkvKiA2NGJp dCBGUyBiYXNlICovCisjZGVmaW5lIE1TUl9GU19CQVNFIDB4YzAwMDAxMDAJCS8qIDY0Yml0IEZT IGJhc2UgKi8KKyNkZWZpbmUgTVNSX0dTX0JBU0UgMHhjMDAwMDEwMQkJLyogNjRiaXQgR1MgYmFz ZSAqLwogI2RlZmluZSBNU1JfS0VSTkVMX0dTX0JBU0UgIDB4YzAwMDAxMDIJLyogU3dhcEdTIEdT IHNoYWRvdyAob3IgVVNFUl9HUyBmcm9tIGtlcm5lbCkgKi8gCiAvKiBFRkVSIGJpdHM6ICovIAog I2RlZmluZSBfRUZFUl9TQ0UgMCAgLyogU1lTQ0FMTC9TWVNSRVQgKi8KZGlmZiAtciA3MDQxNTFk MGUyMTkgeGVuL2FyY2gveDg2L2h2bS9odm0uYwotLS0gYS94ZW4vYXJjaC94ODYvaHZtL2h2bS5j CVRodSBNYXIgMjkgMTg6MjY6MTIgMjAwNyArMDEwMAorKysgYi94ZW4vYXJjaC94ODYvaHZtL2h2 bS5jCUZyaSBNYXIgMzAgMDE6MzU6NTggMjAwNyArMDgwMApAQCAtNTksNiArNTksOSBAQCBzdHJ1 Y3QgaHZtX2Z1bmN0aW9uX3RhYmxlIGh2bV9mdW5jcyBfX3JlCiAvKiBJL08gcGVybWlzc2lvbiBi aXRtYXAgaXMgZ2xvYmFsbHkgc2hhcmVkIGJ5IGFsbCBIVk0gZ3Vlc3RzLiAqLwogY2hhciBfX2F0 dHJpYnV0ZV9fICgoX19zZWN0aW9uX18gKCIuYnNzLnBhZ2VfYWxpZ25lZCIpKSkKICAgICBodm1f aW9fYml0bWFwWzMqUEFHRV9TSVpFXTsKKy8qIG1zciBiaXRtYXAgKi8KK2NoYXIgX19hdHRyaWJ1 dGVfXyAoKF9fc2VjdGlvbl9fICgiLmJzcy5wYWdlX2FsaWduZWQiKSkpCisgICAgaHZtX21zcl9i aXRtYXBbUEFHRV9TSVpFXTsKIAogdm9pZCBodm1fZW5hYmxlKHN0cnVjdCBodm1fZnVuY3Rpb25f dGFibGUgKmZucykKIHsKQEAgLTcxLDYgKzc0LDkgQEAgdm9pZCBodm1fZW5hYmxlKHN0cnVjdCBo dm1fZnVuY3Rpb25fdGFibAogICAgICAqLwogICAgIG1lbXNldChodm1faW9fYml0bWFwLCB+MCwg c2l6ZW9mKGh2bV9pb19iaXRtYXApKTsKICAgICBjbGVhcl9iaXQoMHg4MCwgaHZtX2lvX2JpdG1h cCk7CisKKyAgICAvKiBpbml0aWFsaXplIGh2bV9tc3JfYml0bWFwLCBhbGwgTVNSIGFjY2Vzc2Vz IGNhdXNlIFZNRXhpdHMgc3RpbGwgKi8KKyAgICBtZW1zZXQoaHZtX21zcl9iaXRtYXAsIH4wLCBz aXplb2YoaHZtX21zcl9iaXRtYXApKTsKIAogICAgIGh2bV9mdW5jcyAgID0gKmZuczsKICAgICBo dm1fZW5hYmxlZCA9IDE7CmRpZmYgLXIgNzA0MTUxZDBlMjE5IHhlbi9hcmNoL3g4Ni9odm0vdm14 L3ZtY3MuYwotLS0gYS94ZW4vYXJjaC94ODYvaHZtL3ZteC92bWNzLmMJVGh1IE1hciAyOSAxODoy NjoxMiAyMDA3ICswMTAwCisrKyBiL3hlbi9hcmNoL3g4Ni9odm0vdm14L3ZtY3MuYwlGcmkgTWFy IDMwIDAxOjIyOjI1IDIwMDcgKzA4MDAKQEAgLTM3LDYgKzM3LDQzIEBACiAjaW5jbHVkZSA8eGVu L2tleWhhbmRsZXIuaD4KICNpbmNsdWRlIDxhc20vc2hhZG93Lmg+CiAKKy8qIE1TUiBiaXRtYXAg bWFjcm9zICovCisjZGVmaW5lIE1TUl9CSVRNQVBfUkVBRF9MT1dfT0ZGU0VUICAgICAgMAorI2Rl ZmluZSBNU1JfQklUTUFQX1JFQURfSElHSF9PRkZTRVQgICAgIDEwMjQKKyNkZWZpbmUgTVNSX0JJ VE1BUF9XUklURV9MT1dfT0ZGU0VUICAgICAyMDQ4CisjZGVmaW5lIE1TUl9CSVRNQVBfV1JJVEVf SElHSF9PRkZTRVQgICAgMzA3MgorCisjZGVmaW5lIE1TUl9CSVRNQVBfTE9XX1NUQVJUX0FERFIg ICAweDAwMDAwMDAwCisjZGVmaW5lIE1TUl9CSVRNQVBfTE9XX0VORF9BRERSICAgICAweDAwMDAy MDAwCisjZGVmaW5lIE1TUl9CSVRNQVBfSElHSF9TVEFSVF9BRERSICAweEMwMDAwMDAwCisjZGVm aW5lIE1TUl9CSVRNQVBfSElHSF9FTkRfQUREUiAgICAweEMwMDAyMDAwCisKKy8qIHNldCBNU1Ig Yml0bWFwIHRvIGF2b2lkIHZtIGV4aXQgd2hlbiBhY2Nlc3MgTVNSICovCisjZGVmaW5lIE1TUl9C SVRNQVBfTk9fVk1FWElUX09OKG1zcikgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgeyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisg ICAgICAgIHUzMiBtc3Jfb2Zmc2V0ID0gbXNyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBcCisgICAgICAgIGlmICggKG1zcikgPj0gTVNSX0JJVE1BUF9MT1dfU1RBUlRfQUREUiAmJiAg ICAgICAgICBcCisgICAgICAgICAgICAgKG1zcikgPCBNU1JfQklUTUFQX0xPV19FTkRfQUREUiAp ICAgICAgICAgICAgICBcCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICBtc3Jfb2Zmc2V0IC09IE1TUl9CSVRN QVBfTE9XX1NUQVJUX0FERFI7ICAgICAgICBcCisgICAgICAgICAgICBjbGVhcl9iaXQobXNyX29m ZnNldCwgaHZtX21zcl9iaXRtYXAgKyAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAg TVNSX0JJVE1BUF9SRUFEX0xPV19PRkZTRVQpOyAgICAgICAgICBcCisgICAgICAgICAgICBjbGVh cl9iaXQobXNyX29mZnNldCwgaHZtX21zcl9iaXRtYXAgKyAgICAgICAgICBcCisgICAgICAgICAg ICAgICAgICAgICAgTVNSX0JJVE1BUF9XUklURV9MT1dfT0ZGU0VUKTsgICAgICAgICBcCisgICAg ICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc CisgICAgICAgIGVsc2UgaWYgKCAobXNyKSA+PSBNU1JfQklUTUFQX0hJR0hfU1RBUlRfQUREUiAm JiAgICBcCisgICAgICAgICAgICAgKG1zcikgPCBNU1JfQklUTUFQX0hJR0hfRU5EX0FERFIgKSAg ICAgICAgICAgICBcCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICBtc3Jfb2Zmc2V0IC09IE1TUl9CSVRNQVBf SElHSF9TVEFSVF9BRERSOyAgICAgICBcCisgICAgICAgICAgICBjbGVhcl9iaXQobXNyX29mZnNl dCwgaHZtX21zcl9iaXRtYXAgKyAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgTVNS X0JJVE1BUF9SRUFEX0hJR0hfT0ZGU0VUKTsgICAgICAgICBcCisgICAgICAgICAgICBjbGVhcl9i aXQobXNyX29mZnNldCwgaHZtX21zcl9iaXRtYXAgKyAgICAgICAgICBcCisgICAgICAgICAgICAg ICAgICAgICAgTVNSX0JJVE1BUF9XUklURV9ISUdIX09GRlNFVCk7ICAgICAgICBcCisgICAgICAg IH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisg ICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBcCisgICAgICAgICAgICBCVUcoKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBcCisgICAgfQorCiAvKiBEeW5hbWljIChydW4tdGltZSBhZGp1c3RlZCkgZXhlY3V0 aW9uIGNvbnRyb2wgZmxhZ3MuICovCiBzdGF0aWMgdTMyIHZteF9waW5fYmFzZWRfZXhlY19jb250 cm9sOwogc3RhdGljIHUzMiB2bXhfY3B1X2Jhc2VkX2V4ZWNfY29udHJvbDsKQEAgLTc4LDYgKzEx NSw3IEBAIHZvaWQgdm14X2luaXRfdm1jc19jb25maWcodm9pZCkKICAgICAgICAgICAgICAgICAg Q1BVX0JBU0VEX01XQUlUX0VYSVRJTkcgfAogICAgICAgICAgICAgICAgICBDUFVfQkFTRURfTU9W X0RSX0VYSVRJTkcgfAogICAgICAgICAgICAgICAgICBDUFVfQkFTRURfQUNUSVZBVEVfSU9fQklU TUFQIHwKKyAgICAgICAgICAgICAgICAgQ1BVX0JBU0VEX0FDVElWQVRFX01TUl9CSVRNQVAgfAog ICAgICAgICAgICAgICAgICBDUFVfQkFTRURfVVNFX1RTQ19PRkZTRVRJTkcpOwogI2lmZGVmIF9f eDg2XzY0X18KICAgICBtaW4gPSBtYXggfD0gQ1BVX0JBU0VEX0NSOF9MT0FEX0VYSVRJTkcgfCBD UFVfQkFTRURfQ1I4X1NUT1JFX0VYSVRJTkc7CkBAIC0xMTMsNiArMTUxLDEyIEBAIHZvaWQgdm14 X2luaXRfdm1jc19jb25maWcodm9pZCkKICAgICAgICAgQlVHX09OKHZteF9jcHVfYmFzZWRfZXhl Y19jb250cm9sICE9IF92bXhfY3B1X2Jhc2VkX2V4ZWNfY29udHJvbCk7CiAgICAgICAgIEJVR19P Tih2bXhfdm1leGl0X2NvbnRyb2wgIT0gX3ZteF92bWV4aXRfY29udHJvbCk7CiAgICAgICAgIEJV R19PTih2bXhfdm1lbnRyeV9jb250cm9sICE9IF92bXhfdm1lbnRyeV9jb250cm9sKTsKKyAgICB9 CisKKyAgICBpZiAoIHZteF9jcHVfYmFzZWRfZXhlY19jb250cm9sICYgQ1BVX0JBU0VEX0FDVElW QVRFX01TUl9CSVRNQVAgKQorICAgIHsKKyAgICAgICAgTVNSX0JJVE1BUF9OT19WTUVYSVRfT04o TVNSX0ZTX0JBU0UpOworICAgICAgICBNU1JfQklUTUFQX05PX1ZNRVhJVF9PTihNU1JfR1NfQkFT RSk7CiAgICAgfQogCiAgICAgLyogSUEtMzIgU0RNIFZvbCAzQjogVk1DUyBzaXplIGlzIG5ldmVy IGdyZWF0ZXIgdGhhbiA0a0IuICovCkBAIC0yODcsNiArMzMxLDkgQEAgc3RhdGljIHZvaWQgY29u c3RydWN0X3ZtY3Moc3RydWN0IHZjcHUgKgogICAgIF9fdm13cml0ZShDUFVfQkFTRURfVk1fRVhF Q19DT05UUk9MLCB2bXhfY3B1X2Jhc2VkX2V4ZWNfY29udHJvbCk7CiAgICAgdi0+YXJjaC5odm1f dmNwdS51LnZteC5leGVjX2NvbnRyb2wgPSB2bXhfY3B1X2Jhc2VkX2V4ZWNfY29udHJvbDsKIAor ICAgIGlmICggdm14X2NwdV9iYXNlZF9leGVjX2NvbnRyb2wgJiBDUFVfQkFTRURfQUNUSVZBVEVf TVNSX0JJVE1BUCApCisgICAgICAgIF9fdm13cml0ZShNU1JfQklUTUFQLCB2aXJ0X3RvX21hZGRy KGh2bV9tc3JfYml0bWFwKSk7CisKICAgICAvKiBJL08gYWNjZXNzIGJpdG1hcC4gKi8KICAgICBf X3Ztd3JpdGUoSU9fQklUTUFQX0EsIHZpcnRfdG9fbWFkZHIoaHZtX2lvX2JpdG1hcCkpOwogICAg IF9fdm13cml0ZShJT19CSVRNQVBfQiwgdmlydF90b19tYWRkcihodm1faW9fYml0bWFwICsgUEFH RV9TSVpFKSk7CmRpZmYgLXIgNzA0MTUxZDBlMjE5IHhlbi9pbmNsdWRlL2FzbS14ODYvaHZtL3N1 cHBvcnQuaAotLS0gYS94ZW4vaW5jbHVkZS9hc20teDg2L2h2bS9zdXBwb3J0LmgJVGh1IE1hciAy OSAxODoyNjoxMiAyMDA3ICswMTAwCisrKyBiL3hlbi9pbmNsdWRlL2FzbS14ODYvaHZtL3N1cHBv cnQuaAlUaHUgTWFyIDI5IDEzOjE1OjU0IDIwMDcgKzA4MDAKQEAgLTIxNSw2ICsyMTUsNyBAQCBp bnQgaHZtX2xvYWQoc3RydWN0IGRvbWFpbiAqZCwgaHZtX2RvbWFpCiAvKiBFbmQgb2Ygc2F2ZS9y ZXN0b3JlICovCiAKIGV4dGVybiBjaGFyIGh2bV9pb19iaXRtYXBbXTsKK2V4dGVybiBjaGFyIGh2 bV9tc3JfYml0bWFwW107CiBleHRlcm4gaW50IGh2bV9lbmFibGVkOwogCiB2b2lkIGh2bV9lbmFi bGUoc3RydWN0IGh2bV9mdW5jdGlvbl90YWJsZSAqKTsKZGlmZiAtciA3MDQxNTFkMGUyMTkgeGVu L2luY2x1ZGUvYXNtLXg4Ni9odm0vdm14L3ZtY3MuaAotLS0gYS94ZW4vaW5jbHVkZS9hc20teDg2 L2h2bS92bXgvdm1jcy5oCVRodSBNYXIgMjkgMTg6MjY6MTIgMjAwNyArMDEwMAorKysgYi94ZW4v aW5jbHVkZS9hc20teDg2L2h2bS92bXgvdm1jcy5oCVRodSBNYXIgMjkgMTM6MTU6NTQgMjAwNyAr MDgwMApAQCAtMTA5LDYgKzEwOSw3IEBAIGV4dGVybiBpbnQgdm1jc192ZXJzaW9uOwogI2RlZmlu ZSBDUFVfQkFTRURfTU9WX0RSX0VYSVRJTkcgICAgICAgIDB4MDA4MDAwMDAKICNkZWZpbmUgQ1BV X0JBU0VEX1VOQ09ORF9JT19FWElUSU5HICAgICAweDAxMDAwMDAwCiAjZGVmaW5lIENQVV9CQVNF RF9BQ1RJVkFURV9JT19CSVRNQVAgICAgMHgwMjAwMDAwMAorI2RlZmluZSBDUFVfQkFTRURfQUNU SVZBVEVfTVNSX0JJVE1BUCAgIDB4MTAwMDAwMDAKICNkZWZpbmUgQ1BVX0JBU0VEX01PTklUT1Jf RVhJVElORyAgICAgICAweDIwMDAwMDAwCiAjZGVmaW5lIENQVV9CQVNFRF9QQVVTRV9FWElUSU5H ICAgICAgICAgMHg0MDAwMDAwMAogCkBAIC0xNDMsNiArMTQ0LDggQEAgZW51bSB2bWNzX2ZpZWxk IHsKICAgICBJT19CSVRNQVBfQV9ISUdIICAgICAgICAgICAgICAgID0gMHgwMDAwMjAwMSwKICAg ICBJT19CSVRNQVBfQiAgICAgICAgICAgICAgICAgICAgID0gMHgwMDAwMjAwMiwKICAgICBJT19C SVRNQVBfQl9ISUdIICAgICAgICAgICAgICAgID0gMHgwMDAwMjAwMywKKyAgICBNU1JfQklUTUFQ ICAgICAgICAgICAgICAgICAgICAgID0gMHgwMDAwMjAwNCwKKyAgICBNU1JfQklUTUFQX0hJR0gg ICAgICAgICAgICAgICAgID0gMHgwMDAwMjAwNSwKICAgICBWTV9FWElUX01TUl9TVE9SRV9BRERS ICAgICAgICAgID0gMHgwMDAwMjAwNiwKICAgICBWTV9FWElUX01TUl9TVE9SRV9BRERSX0hJR0gg ICAgID0gMHgwMDAwMjAwNywKICAgICBWTV9FWElUX01TUl9MT0FEX0FERFIgICAgICAgICAgID0g MHgwMDAwMjAwOCwKZGlmZiAtciA3MDQxNTFkMGUyMTkgeGVuL2luY2x1ZGUvYXNtLXg4Ni9tc3Iu aAotLS0gYS94ZW4vaW5jbHVkZS9hc20teDg2L21zci5oCVRodSBNYXIgMjkgMTg6MjY6MTIgMjAw NyArMDEwMAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2L21zci5oCVRodSBNYXIgMjkgMTM6MTU6 NTQgMjAwNyArMDgwMApAQCAtMTI2LDggKzEyNiw4IEBAIHN0YXRpYyBpbmxpbmUgdm9pZCB3cm1z cmwodW5zaWduZWQgaW50IG0KICNkZWZpbmUgTVNSX0xTVEFSIDB4YzAwMDAwODIgCQkvKiBsb25n IG1vZGUgU1lTQ0FMTCB0YXJnZXQgKi8KICNkZWZpbmUgTVNSX0NTVEFSIDB4YzAwMDAwODMJCS8q IGNvbXBhdGliaWxpdHkgbW9kZSBTWVNDQUxMIHRhcmdldCAqLwogI2RlZmluZSBNU1JfU1lTQ0FM TF9NQVNLIDB4YzAwMDAwODQJLyogRUZMQUdTIG1hc2sgZm9yIHN5c2NhbGwgKi8KLSNkZWZpbmUg TVNSX0ZTX0JBU0UgMHhjMDAwMDEwMAkJLyogNjRiaXQgR1MgYmFzZSAqLwotI2RlZmluZSBNU1Jf R1NfQkFTRSAweGMwMDAwMTAxCQkvKiA2NGJpdCBGUyBiYXNlICovCisjZGVmaW5lIE1TUl9GU19C QVNFIDB4YzAwMDAxMDAJCS8qIDY0Yml0IEZTIGJhc2UgKi8KKyNkZWZpbmUgTVNSX0dTX0JBU0Ug MHhjMDAwMDEwMQkJLyogNjRiaXQgR1MgYmFzZSAqLwogI2RlZmluZSBNU1JfU0hBRE9XX0dTX0JB U0UgIDB4YzAwMDAxMDIJLyogU3dhcEdTIEdTIHNoYWRvdyAqLyAKIC8qIEVGRVIgYml0czogKi8g CiAjZGVmaW5lIF9FRkVSX1NDRSAwICAvKiBTWVNDQUxML1NZU1JFVCAqLwo ------_=_NextPart_001_01C7722A.37AA4F72 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------_=_NextPart_001_01C7722A.37AA4F72-- From xen-devel-bounces.xensource.com Thu Mar 29 18:55:13 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 18:55:13 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWyq8-00068V-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 18:55:12 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.253, RCVD_NUMERIC_HELO 1.25) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:44707 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HWypK-0006zU-PC (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 18:54:27 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyq5-0006zw-54; Thu, 29 Mar 2007 17:55:09 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyol-00063b-KR for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:53:47 +0000 Received: from 207.47.60.4.static.nextweb.net ([207.47.60.4] helo=rpc.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWyoi-0001QO-Sg for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:53:45 +0000 Received: from 217.46.209.99 ([217.46.209.99]) by exchpamain.ad.xensource.com ([192.168.3.25]) via Exchange Front-End Server rpc.xensource.com ([192.168.3.26]) with Microsoft Exchange Server HTTP-DAV ; Thu, 29 Mar 2007 17:52:33 +0000 User-Agent: Microsoft-Entourage/11.2.5.060620 Date: Thu, 29 Mar 2007 18:52:21 +0100 From: Keir Fraser <keir@xensource.com> To: "Petersson, Mats" <Mats.Petersson@amd.com>, <xen-devel@lists.xensource.com> Message-ID: <C231BB65.C8BB%keir@xensource.com> Thread-Topic: [Xen-devel] APIC initialization when config file has "apic=0". Thread-Index: AcdyJYQIV4X9azsRTli55zwoSm/8hQABXvQd In-Reply-To: <907625E08839C4409CE5768403633E0B018E1B52@sefsexmb1.amd.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 207.47.60.4 X-SA-Exim-Mail-From: Keir.Fraser@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,RCVD_NUMERIC_HELO autolearn=no version=3.1.0 Subject: Re: [Xen-devel] APIC initialization when config file has "apic=0". X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 29/3/07 18:13, "Petersson, Mats" <Mats.Petersson@amd.com> wrote:> To me, if config file has "apic=0", the APIC should not stop the guest > from being able to use the 8259 as an interrupt source. But this appears > to be the case - and as far as I can see, it''s because the APIC mode is > not initialized (correctly/at all) when the guest is started. > > Shouldn''t "apic=0" mean that the guest appears like there''s no APIC? In > which case, this should mean that the IA32_APIC_BASE MSR should have the > APIC disable bit set.apic=0 simply means we don''t advertise the APIC in the BIOS tables. It''s always physically present, and enabled by default. Its configuration is identical to what you would get from a real physical processor at power on. Bear in mind that platform features such as ''virtual wire'' mode are usually set up by the BIOS, which you are entirely circumventing by replacing hvmloader. You can get around this particular problem by copying hvmloader''s apic_setup() function. If you want PCI functionality you may also want pci_setup(). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 18:57:38 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 18:57:38 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWysU-0006AM-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 18:57:38 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:43316 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HWys2-0007nu-99 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 18:57:18 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWysm-0007Ti-Kh; Thu, 29 Mar 2007 17:57:56 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWysM-00074V-Od for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:57:30 +0000 Received: from mga03.intel.com ([143.182.124.21]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWysJ-0001Ry-N8 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 17:57:28 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 29 Mar 2007 10:56:16 -0700 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by azsmga001.ch.intel.com with ESMTP; 29 Mar 2007 10:56:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,347,1170662400"; d="scan''208"; a="205062316:sNHT2287665940" Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 10:56:08 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C7722B.85C20332" Date: Fri, 30 Mar 2007 01:56:03 +0800 Message-ID: <B30DA1341B0CFA4893EF8A36B40B5C5DF224D6@pdsmsx411.ccr.corp.intel.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH] Fix the assert on size in HVM MMIO flags setting functions Thread-Index: AcdyK4R9d4ZtHvNoSjuv9t5Nzn7rmg=From: "Li, Xin B" <xin.b.li@intel.com> To: <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 29 Mar 2007 17:56:08.0590 (UTC) FILETIME=[878132E0:01C7722B] X-SA-Exim-Connect-IP: 143.182.124.21 X-SA-Exim-Mail-From: xin.b.li@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] [PATCH] Fix the assert on size in HVM MMIO flags setting functions X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. ------_=_NextPart_001_01C7722B.85C20332 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Acturally the size can be 16, meaning 1 byte width in 64bit mode. Also removed some tailing spaces. Signed-off-by: Xin Li <xin.b.li@intel.com> ------_=_NextPart_001_01C7722B.85C20332 Content-Type: application/octet-stream; name="fix_mmio_flag_size.patch" Content-Transfer-Encoding: base64 Content-Description: fix_mmio_flag_size.patch Content-Disposition: attachment; filename="fix_mmio_flag_size.patch" ZGlmZiAtciBmODMwYzU3MTllNzQgeGVuL2FyY2gveDg2L2h2bS9pby5jCi0tLSBhL3hlbi9hcmNo L3g4Ni9odm0vaW8uYwlUaHUgTWFyIDI5IDE4OjA3OjMzIDIwMDcgKzAxMDAKKysrIGIveGVuL2Fy Y2gveDg2L2h2bS9pby5jCUZyaSBNYXIgMzAgMDE6NTE6MDEgMjAwNyArMDgwMApAQCAtMjkzLDgg KzI5MywxNiBAQCBzdGF0aWMgaW5saW5lIHZvaWQgc2V0X2VmbGFnc19DRihpbnQgc2l6CiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHYyLCBzdHJ1Y3QgY3B1 X3VzZXJfcmVncyAqcmVncykKIHsKICAgICB1bnNpZ25lZCBsb25nIG1hc2s7Ci0gICAgCi0gICAg QVNTRVJUKChzaXplIDw9IHNpemVvZihtYXNrKSkgJiYgKHNpemUgPiAwKSk7CisKKyAgICBBU1NF UlQoc2l6ZSA+IDApOworCisgICAgaWYgKCBzaXplID4gc2l6ZW9mKG1hc2spICkKKyAgICB7Cisg ICAgICAgIGlmICggc2l6ZSA9PSBCWVRFXzY0ICkKKyAgICAgICAgICAgIHNpemUgPSBCWVRFOwor ICAgICAgICBlbHNlCisgICAgICAgICAgICBkb21haW5fY3Jhc2hfc3luY2hyb25vdXMoKTsKKyAg ICB9CiAKICAgICBtYXNrID0gfjBVTCA+PiAoOCAqIChzaXplb2YobWFzaykgLSBzaXplKSk7CiAK QEAgLTMwOSwxMCArMzE3LDE4IEBAIHN0YXRpYyBpbmxpbmUgdm9pZCBzZXRfZWZsYWdzX09GKGlu dCBzaXoKIHsKICAgICB1bnNpZ25lZCBsb25nIG1hc2s7CiAKLSAgICBBU1NFUlQoKHNpemUgPD0g c2l6ZW9mKG1hc2spKSAmJiAoc2l6ZSA+IDApKTsKKyAgICBBU1NFUlQoc2l6ZSA+IDApOworCisg ICAgaWYgKCBzaXplID4gc2l6ZW9mKG1hc2spICkKKyAgICB7CisgICAgICAgIGlmICggc2l6ZSA9 PSBCWVRFXzY0ICkKKyAgICAgICAgICAgIHNpemUgPSBCWVRFOworICAgICAgICBlbHNlCisgICAg ICAgICAgICBkb21haW5fY3Jhc2hfc3luY2hyb25vdXMoKTsKKyAgICB9CiAKICAgICBtYXNrID0g fjBVTCA+PiAoOCAqIChzaXplb2YobWFzaykgLSBzaXplKSk7Ci0gICAgCisKICAgICBpZiAoKHYz IF4gdjIpICYgKHYzIF4gdjEpICYgbWFzaykKICAgICAgICAgcmVncy0+ZWZsYWdzIHw9IFg4Nl9F RkxBR1NfT0Y7CiB9CkBAIC0zMjgsOCArMzQ0LDE2IEBAIHN0YXRpYyBpbmxpbmUgdm9pZCBzZXRf ZWZsYWdzX1pGKGludCBzaXoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBjcHVfdXNlcl9yZWdzICpyZWdzKQogewogICAgIHVuc2lnbmVkIGxvbmcgbWFzazsKLSAgICAK LSAgICBBU1NFUlQoKHNpemUgPD0gc2l6ZW9mKG1hc2spKSAmJiAoc2l6ZSA+IDApKTsKKworICAg IEFTU0VSVChzaXplID4gMCk7CisKKyAgICBpZiAoIHNpemUgPiBzaXplb2YobWFzaykgKQorICAg IHsKKyAgICAgICAgaWYgKCBzaXplID09IEJZVEVfNjQgKQorICAgICAgICAgICAgc2l6ZSA9IEJZ VEU7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRvbWFpbl9jcmFzaF9zeW5jaHJvbm91cygp OworICAgIH0KIAogICAgIG1hc2sgPSB+MFVMID4+ICg4ICogKHNpemVvZihtYXNrKSAtIHNpemUp KTsKIApAQCAtMzQxLDggKzM2NSwxNiBAQCBzdGF0aWMgaW5saW5lIHZvaWQgc2V0X2VmbGFnc19T RihpbnQgc2l6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY3B1X3Vz ZXJfcmVncyAqcmVncykKIHsKICAgICB1bnNpZ25lZCBsb25nIG1hc2s7Ci0gICAgCi0gICAgQVNT RVJUKChzaXplIDw9IHNpemVvZihtYXNrKSkgJiYgKHNpemUgPiAwKSk7CisKKyAgICBBU1NFUlQo c2l6ZSA+IDApOworCisgICAgaWYgKCBzaXplID4gc2l6ZW9mKG1hc2spICkKKyAgICB7CisgICAg ICAgIGlmICggc2l6ZSA9PSBCWVRFXzY0ICkKKyAgICAgICAgICAgIHNpemUgPSBCWVRFOworICAg ICAgICBlbHNlCisgICAgICAgICAgICBkb21haW5fY3Jhc2hfc3luY2hyb25vdXMoKTsKKyAgICB9 CiAKICAgICBtYXNrID0gfjBVTCA+PiAoOCAqIChzaXplb2YobWFzaykgLSBzaXplKSk7CiAKQEAg LTM5NSwxNCArNDI3LDE0IEBAIHN0YXRpYyB2b2lkIGh2bV9waW9fYXNzaXN0KHN0cnVjdCBjcHVf dXMKICAgICAgICAgICAgICAgICBpZiAoIGh2bV9wYWdpbmdfZW5hYmxlZChjdXJyZW50KSApCiAg ICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICBpbnQgcnYgPSBodm1fY29weV90 b19ndWVzdF92aXJ0KGFkZHIsICZwLT5kYXRhLCBwLT5zaXplKTsKLSAgICAgICAgICAgICAgICAg ICAgaWYgKCBydiAhPSAwICkgCisgICAgICAgICAgICAgICAgICAgIGlmICggcnYgIT0gMCApCiAg ICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZhaWxlZCBv biB0aGUgcGFnZS1zcGFubmluZyBjb3B5LiAgSW5qZWN0IFBGIGludG8KICAgICAgICAgICAgICAg ICAgICAgICAgICAqIHRoZSBndWVzdCBmb3IgdGhlIGFkZHJlc3Mgd2hlcmUgd2UgZmFpbGVkLiAq LwogICAgICAgICAgICAgICAgICAgICAgICAgYWRkciArPSBwLT5zaXplIC0gcnY7CiAgICAgICAg ICAgICAgICAgICAgICAgICBnZHByaW50ayhYRU5MT0dfREVCVUcsICJQYWdlZmF1bHQgd3JpdGlu ZyBub24taW8gc2lkZSAiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAib2YgYSBw YWdlLXNwYW5uaW5nIFBJTzogdmE9JSNseFxuIiwgYWRkcik7Ci0gICAgICAgICAgICAgICAgICAg ICAgICBodm1faW5qZWN0X2V4Y2VwdGlvbihUUkFQX3BhZ2VfZmF1bHQsIAorICAgICAgICAgICAg ICAgICAgICAgICAgaHZtX2luamVjdF9leGNlcHRpb24oVFJBUF9wYWdlX2ZhdWx0LAogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEZFQ193cml0ZV9hY2Nlc3Ms IGFkZHIpOwogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAg ICAgICB9CkBAIC01MjUsMTQgKzU1NywxNCBAQCBzdGF0aWMgdm9pZCBodm1fbW1pb19hc3Npc3Qo c3RydWN0IGNwdV91CiAgICAgICAgICAgICBpZiAoaHZtX3BhZ2luZ19lbmFibGVkKGN1cnJlbnQp KQogICAgICAgICAgICAgewogICAgICAgICAgICAgICAgIGludCBydiA9IGh2bV9jb3B5X3RvX2d1 ZXN0X3ZpcnQoYWRkciwgJnAtPmRhdGEsIHAtPnNpemUpOwotICAgICAgICAgICAgICAgIGlmICgg cnYgIT0gMCApIAorICAgICAgICAgICAgICAgIGlmICggcnYgIT0gMCApCiAgICAgICAgICAgICAg ICAgewogICAgICAgICAgICAgICAgICAgICAvKiBGYWlsZWQgb24gdGhlIHBhZ2Utc3Bhbm5pbmcg Y29weS4gIEluamVjdCBQRiBpbnRvCiAgICAgICAgICAgICAgICAgICAgICAqIHRoZSBndWVzdCBm b3IgdGhlIGFkZHJlc3Mgd2hlcmUgd2UgZmFpbGVkLiAqLwogICAgICAgICAgICAgICAgICAgICBh ZGRyICs9IHAtPnNpemUgLSBydjsKICAgICAgICAgICAgICAgICAgICAgZ2RwcmludGsoWEVOTE9H X0RFQlVHLCAiUGFnZWZhdWx0IHdyaXRpbmcgbm9uLWlvIHNpZGUgb2YgIgogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAiYSBwYWdlLXNwYW5uaW5nIE1NSU86IHZhPSUjbHhcbiIsIGFkZHIp OwotICAgICAgICAgICAgICAgICAgICBodm1faW5qZWN0X2V4Y2VwdGlvbihUUkFQX3BhZ2VfZmF1 bHQsIAorICAgICAgICAgICAgICAgICAgICBodm1faW5qZWN0X2V4Y2VwdGlvbihUUkFQX3BhZ2Vf ZmF1bHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBGRUNfd3Jp dGVfYWNjZXNzLCBhZGRyKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAg ICAgICAgIH0KQEAgLTczOCwxNCArNzcwLDE0IEBAIHN0YXRpYyB2b2lkIGh2bV9tbWlvX2Fzc2lz dChzdHJ1Y3QgY3B1X3UKIAogICAgIGNhc2UgSU5TVFJfUFVTSDoKICAgICAgICAgbW1pb19vcHAt PmFkZHIgKz0gaHZtX2dldF9zZWdtZW50X2Jhc2UoY3VycmVudCwgeDg2X3NlZ19zcyk7Ci0gICAg ICAgIHsgCisgICAgICAgIHsKICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgYWRkciA9IG1taW9f b3BwLT5hZGRyOwogICAgICAgICAgICAgaW50IHJ2ID0gaHZtX2NvcHlfdG9fZ3Vlc3RfdmlydChh ZGRyLCAmcC0+ZGF0YSwgc2l6ZSk7Ci0gICAgICAgICAgICBpZiAoIHJ2ICE9IDAgKSAKKyAgICAg ICAgICAgIGlmICggcnYgIT0gMCApCiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgYWRk ciArPSBwLT5zaXplIC0gcnY7Ci0gICAgICAgICAgICAgICAgZ2RwcmludGsoWEVOTE9HX0RFQlVH LCAiUGFnZWZhdWx0IGVtdWxhdGluZyBQVVNIIGZyb20gTU1JTzogIgotICAgICAgICAgICAgICAg ICAgICAgICAgICJ2YT0lI2x4XG4iLCBhZGRyKTsKKyAgICAgICAgICAgICAgICBnZHByaW50ayhY RU5MT0dfREVCVUcsICJQYWdlZmF1bHQgZW11bGF0aW5nIFBVU0ggZnJvbSBNTUlPOiIKKyAgICAg ICAgICAgICAgICAgICAgICAgICAiIHZhPSUjbHhcbiIsIGFkZHIpOwogICAgICAgICAgICAgICAg IGh2bV9pbmplY3RfZXhjZXB0aW9uKFRSQVBfcGFnZV9mYXVsdCwgUEZFQ193cml0ZV9hY2Nlc3Ms IGFkZHIpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KQEAgLTc4Nyw3 ICs4MTksNyBAQCB2b2lkIGh2bV9pb19hc3Npc3Qoc3RydWN0IHZjcHUgKnYpCiAgICAgbWVtY3B5 KGd1ZXN0X2NwdV91c2VyX3JlZ3MoKSwgcmVncywgSFZNX0NPTlRFWFRfU1RBQ0tfQllURVMpOwog CiAgICAgLyogSGFzIG1lbW9yeSBiZWVuIGRpcnRpZWQ/ICovCi0gICAgaWYgKCBwLT5kaXIgPT0g SU9SRVFfUkVBRCAmJiBwLT5kYXRhX2lzX3B0ciApIAorICAgIGlmICggcC0+ZGlyID09IElPUkVR X1JFQUQgJiYgcC0+ZGF0YV9pc19wdHIgKQogICAgIHsKICAgICAgICAgZ21mbiA9IGdldF9tZm5f ZnJvbV9ncGZuKHBhZ2luZ19ndmFfdG9fZ2ZuKHYsIHAtPmRhdGEpKTsKICAgICAgICAgbWFya19k aXJ0eSh2LT5kb21haW4sIGdtZm4pOwo ------_=_NextPart_001_01C7722B.85C20332 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------_=_NextPart_001_01C7722B.85C20332-- From xen-devel-bounces.xensource.com Thu Mar 29 19:06:34 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 19:06:34 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWz18-0006J0-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 19:06:34 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:46182 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HWyz8-0005j0-Fk (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 19:04:35 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyzs-0000ko-GR; Thu, 29 Mar 2007 18:05:16 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWyzU-0000SB-12 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 18:04:52 +0000 Received: from mga09.intel.com ([134.134.136.24]) by lists.xensource.com with esmtp (Exim 4.50) id 1HWyzR-0001U4-4i for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 18:04:49 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by mga09.intel.com with ESMTP; 29 Mar 2007 11:03:38 -0700 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by fmsmga002.fm.intel.com with ESMTP; 29 Mar 2007 11:03:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,347,1170662400"; d="scan''208"; a="65972288:sNHT25116273" Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 11:03:37 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Mar 2007 02:03:34 +0800 Message-ID: <B30DA1341B0CFA4893EF8A36B40B5C5DF224D8@pdsmsx411.ccr.corp.intel.com> In-Reply-To: <B30DA1341B0CFA4893EF8A36B40B5C5DF224D6@pdsmsx411.ccr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] [PATCH] Fix the assert on size in HVM MMIO flagssetting functions Thread-Index: AcdyK4R9d4ZtHvNoSjuv9t5Nzn7rmgAADhcQ From: "Li, Xin B" <xin.b.li@intel.com> To: "Li, Xin B" <xin.b.li@intel.com>, <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 29 Mar 2007 18:03:37.0506 (UTC) FILETIME=[93145820:01C7722C] X-SA-Exim-Connect-IP: 134.134.136.24 X-SA-Exim-Mail-From: xin.b.li@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] [PATCH] Fix the assert on size in HVM MMIO flagssetting functions X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com I also noticed in hvm_mmio_assist INSTR_ADD handling doesn''t set CF/OF/... properly, and INSTR_OR doesn''t set flags at all, seems it''s caused when we add INSTR_ADD handling to a wrong place! -Xin=20>-----Original Message----- >From: xen-devel-bounces@lists.xensource.com=20 >[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Li, Xin B >Sent: Friday, March 30, 2007 1:56 AM >To: xen-devel@lists.xensource.com >Subject: [Xen-devel] [PATCH] Fix the assert on size in HVM=20 >MMIO flagssetting functions > >Acturally the size can be 16, meaning 1 byte width in 64bit mode. >Also removed some tailing spaces. > >Signed-off-by: Xin Li <xin.b.li@intel.com> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 19:19:24 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 19:19:24 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HWzDY-000494-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 19:19:24 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.253, RCVD_NUMERIC_HELO 1.25) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:51420 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HWzD2-0004W1-UY (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 19:18:57 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWzDm-0001IW-3V; Thu, 29 Mar 2007 18:19:38 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWzDP-000101-FX for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 18:19:15 +0000 Received: from 207.47.60.4.static.nextweb.net ([207.47.60.4] helo=rpc.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HWzDJ-0001Vv-4E for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 18:19:13 +0000 Received: from 217.46.209.99 ([217.46.209.99]) by exchpamain.ad.xensource.com ([192.168.3.25]) via Exchange Front-End Server rpc.xensource.com ([192.168.3.26]) with Microsoft Exchange Server HTTP-DAV ; Thu, 29 Mar 2007 18:17:57 +0000 User-Agent: Microsoft-Entourage/11.2.5.060620 Date: Thu, 29 Mar 2007 19:17:46 +0100 From: Keir Fraser <keir@xensource.com> To: "Li, Xin B" <xin.b.li@intel.com>, <xen-devel@lists.xensource.com> Message-ID: <C231C15A.C8C2%keir@xensource.com> Thread-Topic: [Xen-devel] [PATCH] Enable VMX MSR bitmap support Thread-Index: AcdyKjZ/7APHhrjjQt+EbbWJ0G+NwgABFZSW In-Reply-To: <B30DA1341B0CFA4893EF8A36B40B5C5DF224D4@pdsmsx411.ccr.corp.intel.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 207.47.60.4 X-SA-Exim-Mail-From: Keir.Fraser@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,RCVD_NUMERIC_HELO autolearn=no version=3.1.0 Subject: Re: [Xen-devel] [PATCH] Enable VMX MSR bitmap support X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Cleaned up and checked in. The code to clear bits in the bitmap did not need to be a humungous macro. Also you got the write-low and read-high offsets into the MSR bitmap the wrong way round! -- Keir On 29/3/07 18:46, "Li, Xin B" <xin.b.li@intel.com> wrote:> We use it to avoid VMExits on FS_BASE and GS_BASE MSR accesses. > > Signed-off-by: Weidong Han <weidong.han@intel.com> > Signed-off-by: Xin Li <xin.b.li@intel.com> > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 20:37:43 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 20:37:43 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX0RL-0008N0-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 20:37:43 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:44305 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HX0QS-0004Cx-0E (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 20:36:53 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX0R8-00037G-NC; Thu, 29 Mar 2007 19:37:30 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX0Qn-0002p9-26 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 19:37:09 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[NSU3DvdtOfUTGnAxxTz3yAHmtPdHAaef]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX0Qk-00023s-Di for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 19:37:06 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX0Pc-0005pV-00 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 20:35:56 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Thu, 29 Mar 2007 20:36:56 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Xen Development Mailing List <xen-devel@lists.xensource.com> Message-ID: <C231D3E8.5227%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: Xen-unstable feature freeze for 3.0.5 release Thread-Index: AcdyOZwK2mymwt4sEduNzQAWy6hiGQ=Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Xen-unstable feature freeze for 3.0.5 release X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Folks, The unstable tree has now been open for development for three months since 3.0.4, and it''s now time to spend a couple of weeks stabilising the tree in preparation for the 3.0.5 release. Important improvements in this new release will include HVM save/restore, XenAPI management interfaces, upgrade to Linux 2.6.18, many more improvements to the IA64 and PPC ports, and lots of general improvements to stability and performance.>From here on we will be accepting only bug-fix and feature-regressionpatches, and concentrating on final stabilisation of HVM save/restore and XenAPI. Other small patches may be individually considered for inclusion but are likely to be held off until after we call the 3.0.5 final release. We plan to fork a release candidate in two weeks time. Many thanks, Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 22:19:26 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 22:19:26 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX21m-0001sG-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 22:19:26 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.435, HTML_MESSAGE 0.00, HTML_TAG_BALANCE_BODY 0.18, RCVD_NUMERIC_HELO 1.25, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:47270 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HX21E-0007Pq-FF (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 22:18:57 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX21y-00051k-80; Thu, 29 Mar 2007 21:19:38 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX21Z-0004je-QY for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 21:19:13 +0000 Received: from mga03.intel.com ([143.182.124.21]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX21V-0002gK-GM for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 21:19:11 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 29 Mar 2007 14:17:58 -0700 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by azsmga001.ch.intel.com with ESMTP; 29 Mar 2007 14:17:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,348,1170662400"; d="asc''?scan''208,217"; a="205172095:sNHT49764022" Received: from scsmsx412.amr.corp.intel.com ([10.3.90.31]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 14:17:56 -0700 Received: from 143.183.140.150 ([143.183.140.150]) by scsmsx412.amr.corp.intel.com ([10.3.90.31]) via Exchange Front-End Server email.intel.com ([192.168.65.22]) with Microsoft Exchange Server HTTP-DAV ; Thu, 29 Mar 2007 21:17:55 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Received: from lnitindesktop by email.intel.com; 29 Mar 2007 14:17:55 -0700 Content-class: urn:content-classes:message Date: Thu, 29 Mar 2007 14:17:55 -0700 Message-ID: <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> In-Reply-To: <4607074E.1030807@us.ibm.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH][RFC] Emulating real mode with x86_emulate Thread-Index: AcdyR7f1QF9ADfOnQTqAEJfuifvO1w=References: <4607074E.1030807@us.ibm.com> From: "Kamble, Nitin A" <nitin.a.kamble@intel.com> To: "Anthony Liguori" <aliguori@us.ibm.com> X-OriginalArrivalTime: 29 Mar 2007 21:17:56.0370 (UTC) FILETIME=[B84DCF20:01C77247] X-SA-Exim-Connect-IP: 143.182.124.21 X-SA-Exim-Mail-From: nitin.a.kamble@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0859694023==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --===============0859694023=Content-Type: multipart/signed; boundary="=-MlUu6QCT3GcfubhjksnE"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-MlUu6QCT3GcfubhjksnE Content-Type: multipart/alternative; boundary="=-xRnzlvB56UBj5KEYrtz4" --=-xRnzlvB56UBj5KEYrtz4 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Anthony, I tried your patch at my end with snapshot of xen-unstable on 20070326. And here are my findings. - The --emulate-16bit option for qemu did not work. qemu is not accepting this as an valid command line option. - I tried hardcoding this to 1 in the qemu code, and found that the port x595 is not reflecting it correctly to hvmloader. - Then I tried forcing in the hvmloader to use the emulator instead of vmxassit, and I see the the emulator is not getting the right context. Following is the console log at this point. (XEN) HVM3: HVM Loader =20 (XEN) HVM3: Detected Xen v3.0-unstable =20 (XEN) HVM3: Writing SMBIOS tables ... =20 (XEN) HVM3: Loading ROMBIOS ... =20 (XEN) irq.c:210: Dom3 PCI link 0 changed 0 -> 5 =20 (XEN) HVM3: PCI-ISA link 0 routed to IRQ5 =20 (XEN) irq.c:210: Dom3 PCI link 1 changed 0 -> 7 =20 (XEN) HVM3: PCI-ISA link 1 routed to IRQ7 =20 (XEN) irq.c:210: Dom3 PCI link 2 changed 0 -> 10 =20 (XEN) HVM3: PCI-ISA link 2 routed to IRQ10 =20 (XEN) irq.c:210: Dom3 PCI link 3 changed 0 -> 11 =20 (XEN) HVM3: PCI-ISA link 3 routed to IRQ11 =20 (XEN) HVM3: pci dev 01:1 bar 20 size 00000010: 0000c001 =20 (XEN) HVM3: pci dev 01:2 INTA->IRQ7 =20 (XEN) HVM3: pci dev 02:0 bar 10 size 02000000: f0000008 =20 (XEN) HVM3: pci dev 02:0 bar 14 size 00001000: f2000000 =20 (XEN) HVM3: pci dev 03:0 bar 10 size 00000100: 0000c101 =20 (XEN) HVM3: pci dev 03:0 bar 14 size 01000000: f3000008 =20 (XEN) HVM3: pci dev 03:0 INTA->IRQ11 =20 (XEN) HVM3: pci dev 04:0 bar 10 size 00000100: 0000c201 =20 (XEN) HVM3: pci dev 04:0 bar 14 size 00000100: f4000000 =20 (XEN) HVM3: pci dev 04:0 INTA->IRQ5 =20 (XEN) HVM3: Creating MP tables ... =20 (XEN) HVM3: Loading Cirrus VGABIOS ... =20 (XEN) HVM3: Loading ACPI ... =20 (XEN) HVM3: Not Loading VMXAssist ... ffffffff =20 (XEN) HVM3: foo =20 (XEN) hvmop_emulate_realmode =20 (XEN) guest requests real mode emulation =20 (XEN) foo 221 =20 (XEN) HVM3: Invoking ROMBIOS ... =20 (XEN) Transfering control to x86_emulate %eip 0x0 =20 (XEN) hvm.c:446:d3 Triple fault on VCPU0 - invoking HVM system reset. =20 The log shows that emulator is not getting the right cpu context.=20 How much of testing have you done with this code? I am not able to proceed to emulation of 1 instruction with the patch. How many instruction could you emulate with the patch? Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it''s open.=20 On Sun, 2007-03-25 at 16:35 -0700, Anthony Liguori wrote:> Howdy, >=20 > Attached is a patch that begins to lay down the infrastructure for > emulating real mode with x86_emulate(). With a little more > refactoring, > I think it could also replace the SVM emulator. >=20 > The patch introduces an HVMOP hypercall to set a flag in the hvm vcpu > struct to signal that real mode should be emulated with x86_emulate > instead of using vm86. This is to make development a little bit > easier > since x86_emulate is not quite there yet wrt 16 bit emulation. It can > be enabled by passing -emulate-16bit to qemu-dm (I use a wrapper > script > similar to qemu-dm.debug). >=20 > The VT code keeps track of the whether it''s in the emulator and loops > on > the do_resume path in x86_emulate. I think this code probably should > be > refactored into the common HVM code although this would require > changing > some of the HVM ops. This would allow SVM to use the x86_emulate to > handle individual instructions. >=20 > There are some issues to work out. Namely, x86_emulate appears to > want > blocking PIO calls which isn''t conducive to the wait PIO works today > in > HVM. This is only a problem for instructions at the moment. I''m also > a > bit confused about how to properly loop in the emulator. > schedule_tail > is not meant to return so perhaps we should loop on emulating =3D=3D 1 > instead of hypercall_preempt_check? I didn''t think the hypervisor was > preemptable though. >=20 > The current code doesn''t handle non-flat segments as I don''t think > hvm_copy_from/to_guest handles it (which I assume it would need to). >=20 > However, it is enough to start running instructions in x86_emulate so > it''s enough to start working on enhancing that. >=20 > Regards, >=20 > Anthony Liguori >=20 >=20--=-xRnzlvB56UBj5KEYrtz4 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8"> <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.3"> <TITLE>[PATCH][RFC] Emulating real mode with x86_emulate</TITLE> </HEAD> <BODY> Hi Anthony,<BR> I tried your patch at my end with snapshot of xen-unstable on 20070326. And here are my findings.<BR> - The --emulate-16bit option for qemu did not work. qemu is not accepting this as an valid command line option.<BR> - I tried hardcoding this to 1 in the qemu code, and found that the port x595 is not reflecting it correctly to hvmloader.<BR> - Then I tried forcing in the hvmloader to use the emulator instead of vmxassit, and I see the the emulator is not getting the right context. Following is the console log at this point.<BR> <BR> (XEN) HVM3: HVM Loader <BR> (XEN) HVM3: Detected Xen v3.0-unstable <BR> (XEN) HVM3: Writing SMBIOS tables ... <BR> (XEN) HVM3: Loading ROMBIOS ... <BR> (XEN) irq.c:210: Dom3 PCI link 0 changed 0 -> 5 <BR> (XEN) HVM3: PCI-ISA link 0 routed to IRQ5 <BR> (XEN) irq.c:210: Dom3 PCI link 1 changed 0 -> 7 <BR> (XEN) HVM3: PCI-ISA link 1 routed to IRQ7 <BR> (XEN) irq.c:210: Dom3 PCI link 2 changed 0 -> 10 <BR> (XEN) HVM3: PCI-ISA link 2 routed to IRQ10 <BR> (XEN) irq.c:210: Dom3 PCI link 3 changed 0 -> 11 <BR> (XEN) HVM3: PCI-ISA link 3 routed to IRQ11 <BR> (XEN) HVM3: pci dev 01:1 bar 20 size 00000010: 0000c001 <BR> (XEN) HVM3: pci dev 01:2 INTA->IRQ7 <BR> (XEN) HVM3: pci dev 02:0 bar 10 size 02000000: f0000008 <BR> (XEN) HVM3: pci dev 02:0 bar 14 size 00001000: f2000000 <BR> (XEN) HVM3: pci dev 03:0 bar 10 size 00000100: 0000c101 <BR> (XEN) HVM3: pci dev 03:0 bar 14 size 01000000: f3000008 <BR> (XEN) HVM3: pci dev 03:0 INTA->IRQ11 <BR> (XEN) HVM3: pci dev 04:0 bar 10 size 00000100: 0000c201 <BR> (XEN) HVM3: pci dev 04:0 bar 14 size 00000100: f4000000 <BR> (XEN) HVM3: pci dev 04:0 INTA->IRQ5 <BR> (XEN) HVM3: Creating MP tables ... <BR> (XEN) HVM3: Loading Cirrus VGABIOS ... <BR> (XEN) HVM3: Loading ACPI ... <BR> (XEN) HVM3: Not Loading VMXAssist ... ffffffff <BR> (XEN) HVM3: foo <BR> (XEN) hvmop_emulate_realmode <BR> (XEN) guest requests real mode emulation <BR> (XEN) foo 221 <BR> (XEN) HVM3: Invoking ROMBIOS ... <BR> (XEN) Transfering control to x86_emulate %eip 0x0 <BR> (XEN) hvm.c:446:d3 Triple fault on VCPU0 - invoking HVM system reset. <BR> <BR> The log shows that emulator is not getting the right cpu context. <BR> How much of testing have you done with this code? I am not able to proceed to emulation of 1 instruction with the patch. How many instruction could you emulate with the patch?<BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> On Sun, 2007-03-25 at 16:35 -0700, Anthony Liguori wrote:<BR> <BLOCKQUOTE TYPE=3DCITE> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">Howdy,</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">Attached is a patch that begins to lay down the infrastructure for</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">emulating real mode with x86_emulate(). With a little more refactoring,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">I think it could also replace the SVM emulator.</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">The patch introduces an HVMOP hypercall to set a flag in the hvm vcpu</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">struct to signal that real mode should be emulated with x86_emulate</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">instead of using vm86. This is to make development a little bit easier</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">since x86_emulate is not quite there yet wrt 16 bit emulation. It can</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">be enabled by passing -emulate-16bit to qemu-dm (I use a wrapper script</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">similar to qemu-dm.debug).</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">The VT code keeps track of the whether it''s in the emulator and loops on</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">the do_resume path in x86_emulate. I think this code probably should be</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">refactored into the common HVM code although this would require changing</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">some of the HVM ops. This would allow SVM to use the x86_emulate to</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">handle individual instructions.</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">There are some issues to work out. Namely, x86_emulate appears to want</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">blocking PIO calls which isn''t conducive to the wait PIO works today in</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">HVM. This is only a problem for instructions at the moment. I''m also a</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">bit confused about how to properly loop in the emulator. schedule_tail</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">is not meant to return so perhaps we should loop on emulating =3D=3D 1</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">instead of hypercall_preempt_check? I didn''t think the hypervisor was</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">preemptable though.</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">The current code doesn''t handle non-flat segments as I don''t think</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">hvm_copy_from/to_guest handles it (which I assume it would need to).</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">However, it is enough to start running instructions in x86_emulate so</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">it''s enough to start working on enhancing that.</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">Regards,</FONT></FONT><BR> <BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#000000">Anthony Liguori</FONT></FONT><BR> <BR> <BR> </BLOCKQUOTE> <BR> </BODY> </HTML> --=-xRnzlvB56UBj5KEYrtz4-- --=-MlUu6QCT3GcfubhjksnE Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGDC0DZ1sfU7kTCR8RAmWLAJ0Y2ZXaJUxw4xuhweBOFBiOirw8ywCfXTFc 5fpPXdkTZEEWXTqHtxv15Ns=bL3H -----END PGP SIGNATURE----- --=-MlUu6QCT3GcfubhjksnE-- --===============0859694023=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0859694023==-- From xen-devel-bounces.xensource.com Thu Mar 29 22:54:10 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 22:54:10 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX2ZN-0000Ne-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 22:54:09 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:59477 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HX2Z2-00053T-OY (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 22:53:53 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX2Zn-0005Xe-2T; Thu, 29 Mar 2007 21:54:35 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX2ZR-0005G1-2g for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 21:54:13 +0000 Received: from galois.com ([69.30.123.195] helo=twofish.galois.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HX2ZI-0002u3-PR for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 21:54:10 +0000 Received: from [192.168.50.73] (dyn-50-73.galois.com [192.168.50.73]) (authenticated bits=0) by twofish.galois.com (8.13.1/8.13.1) with ESMTP id l2TLqqYE013863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 14:52:53 -0700 Message-ID: <460C3534.8020002@galois.com> Date: Thu, 29 Mar 2007 14:52:52 -0700 From: Magnus Carlsson <magnus@galois.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070303) MIME-Version: 1.0 To: xen-devel@lists.xensource.com X-Enigmail-Version: 0.94.1.0 Content-Type: multipart/mixed; boundary="------------060704000105010506050606" X-Virus-Scanned: ClamAV 0.90.1/2962/Thu Mar 29 11:39:44 2007 on twofish.galois.com X-Virus-Status: Clean X-SA-Exim-Connect-IP: 69.30.123.195 X-SA-Exim-Mail-From: magnus@galois.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] [PATCH] Fix that makes xend tracing thread safe X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. --------------060704000105010506050606 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Currently, the output in xend.trace is sometimes garbled since multiple threads write to it simultaneously. The following patch fixes that. It also adds an initial field with the thread name on each traced line, which makes it easier to follow the trace. (If this is considered a new feature which shouldn''t be included due to the feature freeze, it can be disabled by removing the first line in print_trace.) Cheers, Magnus --------------060704000105010506050606 Content-Type: text/x-patch; name="SrvDaemon.py-tracing-thread-safe.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="SrvDaemon.py-tracing-thread-safe.patch" # HG changeset patch # User Magnus Carlsson <magnus@galois.com> # Date 1175203666 25200 # Node ID c51f65166e062eee00bc99424bbe56f547f3dcfa # Parent ffb9dda429461442b0e727775a810b352ec74c9c Made tracing thread safe, and also print thread name. diff -r ffb9dda42946 -r c51f65166e06 tools/python/xen/xend/server/SrvDaemon.py --- a/tools/python/xen/xend/server/SrvDaemon.py Wed Mar 28 16:52:05 2007 +0100 +++ b/tools/python/xen/xend/server/SrvDaemon.py Thu Mar 29 14:27:46 2007 -0700 @@ -38,7 +38,8 @@ class Daemon: self.traceon = False self.tracefile = None self.traceindent = 0 - self.child = 0 + self.child = 0 + self.traceLock = threading.Lock() def cleanup_xend(self, kill): @@ -253,6 +254,7 @@ class Daemon: pass def print_trace(self, string): + self.tracefile.write("%s: "% threading.currentThread().getName()) for i in range(self.traceindent): ch = " " if (i % 5): @@ -263,50 +265,54 @@ class Daemon: self.tracefile.write(string) def trace(self, frame, event, arg): - if not self.traceon: - print >>self.tracefile - print >>self.tracefile, ''-'' * 20, ''TRACE OFF'', ''-'' * 20 - self.tracefile.close() - self.tracefile = None - return None - if event == ''call'': - code = frame.f_code - filename = code.co_filename - m = re.search(''.*xend/(.*)'', filename) - if not m: + self.traceLock.acquire() + try: + if not self.traceon: + print >>self.tracefile + print >>self.tracefile, ''-'' * 20, ''TRACE OFF'', ''-'' * 20 + self.tracefile.close() + self.tracefile = None return None - modulename = m.group(1) - if modulename.endswith(''.pyc''): - modulename = modulename[:-1] - if modulename == ''sxp.py'' or \ - modulename == ''XendLogging.py'' or \ - modulename == ''XendMonitor.py'' or \ - modulename == ''server/SrvServer.py'': - return None - self.traceindent += 1 - self.print_trace("> %s:%s\n" - % (modulename, code.co_name)) - elif event == ''line'': - filename = frame.f_code.co_filename - lineno = frame.f_lineno - self.print_trace("%4d %s" % - (lineno, linecache.getline(filename, lineno))) - elif event == ''return'': - code = frame.f_code - filename = code.co_filename - m = re.search(''.*xend/(.*)'', filename) - if not m: - return None - modulename = m.group(1) - self.print_trace("< %s:%s\n" - % (modulename, code.co_name)) - self.traceindent -= 1 - elif event == ''exception'': - self.print_trace("! Exception:\n") - (ex, val, tb) = arg - traceback.print_exception(ex, val, tb, 10, self.tracefile) - #del tb - return self.trace + if event == ''call'': + code = frame.f_code + filename = code.co_filename + m = re.search(''.*xend/(.*)'', filename) + if not m: + return None + modulename = m.group(1) + if modulename.endswith(''.pyc''): + modulename = modulename[:-1] + if modulename == ''sxp.py'' or \ + modulename == ''XendLogging.py'' or \ + modulename == ''XendMonitor.py'' or \ + modulename == ''server/SrvServer.py'': + return None + self.traceindent += 1 + self.print_trace("> %s:%s\n" + % (modulename, code.co_name)) + elif event == ''line'': + filename = frame.f_code.co_filename + lineno = frame.f_lineno + self.print_trace("%4d %s" % + (lineno, linecache.getline(filename, lineno))) + elif event == ''return'': + code = frame.f_code + filename = code.co_filename + m = re.search(''.*xend/(.*)'', filename) + if not m: + return None + modulename = m.group(1) + self.print_trace("< %s:%s\n" + % (modulename, code.co_name)) + self.traceindent -= 1 + elif event == ''exception'': + self.print_trace("! Exception:\n") + (ex, val, tb) = arg + traceback.print_exception(ex, val, tb, 10, self.tracefile) + #del tb + return self.trace + finally: + self.traceLock.release() def set_user(self): # Set the UID. --------------060704000105010506050606 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------060704000105010506050606-- From xen-devel-bounces.xensource.com Thu Mar 29 23:29:11 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 23:29:11 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX37H-00039V-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 23:29:11 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:45910 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HX36n-0007ur-Tw (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 23:28:46 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX37W-00060U-HI; Thu, 29 Mar 2007 22:29:26 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX37A-0005iG-Ou for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 22:29:04 +0000 Received: from usea-naimss3.unisys.com ([192.61.61.105]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX376-0003Fz-Vi for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 22:29:02 +0000 Received: from usea-nagw1.na.uis.unisys.com ([129.224.72.16]) by usea-naimss3 with InterScan Message Security Suite; Thu, 29 Mar 2007 17:27:47 -0500 Received: from usea-nagw1.na.uis.unisys.com ([129.224.72.51]) by usea-nagw1.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 17:27:47 -0500 Received: from USTR-EXCH5.na.uis.unisys.com ([192.63.225.140]) by usea-nagw1.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 17:27:47 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Mar 2007 18:27:45 -0400 Message-ID: <94C8C9E8B25F564F95185BDA64AB05F604E3B2C8@USTR-EXCH5.na.uis.unisys.com> In-Reply-To: <1175147205.29659.14.camel@cthulhu.hellion.org.uk> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] Is unmodified_drivers broken? Thread-Index: Acdxxam2ZibmE6LcQ36y2CUqoibGAAAicDxg From: "Subrahmanian, Raj" <raj.subrahmanian@unisys.com> To: "Ian Campbell" <Ian.Campbell@XenSource.com>, "Nowatzki, Thomas L" <Thomas.Nowatzki@UNISYS.com> X-OriginalArrivalTime: 29 Mar 2007 22:27:47.0045 (UTC) FILETIME=[7A241150:01C77251] X-SA-Exim-Connect-IP: 192.61.61.105 X-SA-Exim-Mail-From: raj.subrahmanian@unisys.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] Is unmodified_drivers broken? X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Ian>> All, I tried to compile unmodified drivers on the latest changeset(14631).>> The compile breaks.This is what I did. I booted up a x86_64 hvmdomain that was=20>> running sles 10, I copied the entire xen-unstable tree into thedomain.>> Then, I went into the unmodified_drivers directory and ranmkbuildtree=20>> and make -C /usr/src/linux M=3D$PWD V=3D1 modules . >> I have posted the results.=20 >>=20 >> - Have others seen this issue? - Is this because of some kind of messup where the=20>> /usr/src/linux/include/xen directory is clashing with the local=20 >> include/xen directory? Looking at the overrides.mk file, it does seemlike the local=20>> directory is getting included first. > >That''s correct. The include/xen directory in the kernel you=20 >are building against is clashing with the one in the=20 >unmodified drivers. The workaround is to rename include/xen in=20 >the kernel to something else. > >Unfortunately Kbuild doesn''t give us an easy way to make sure=20 >our headers take precedence over the in kernel ones.Thank you for your response.=20 I discovered that just renaming the include/xen directory does not help. There''s still a clash. I discovered that the following directories need to be deleted/renamed. /usr/src/linux/include/xen /usr/src/linux/incude/asm-i386/mach-xen And then, run mkbuildtree and do make as in the README file, and I am good to go. So, here''s my question : Even though I am on a x86_64 hvm, why does it include and compile code from asm-i386? Renaming (or not renaming the) asm-x86_64/mach-xen seems to have absolutely no effect. Raj _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 23:34:34 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 23:34:34 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX3CU-0001CM-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 23:34:34 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:42292 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HX3CA-00052M-F0 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 23:34:19 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX3Cu-0006Nb-Rs; Thu, 29 Mar 2007 22:35:00 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX3CX-000657-BN for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 22:34:37 +0000 Received: from 207.47.60.150.static.nextweb.net ([207.47.60.150] helo=webmail.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HX3CU-0003Gn-N1 for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 22:34:35 +0000 Received: from leeni.uk.xensource.com ([172.31.0.52]) by webmail.xensource.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 14:33:23 -0800 Received: from emellor by leeni.uk.xensource.com with local (Exim 4.50) id 1HX3BK-0001wB-Mq; Thu, 29 Mar 2007 23:33:22 +0100 Date: Thu, 29 Mar 2007 23:33:22 +0100 From: Ewan Mellor <ewan@xensource.com> To: Magnus Carlsson <magnus@galois.com> Message-ID: <20070329223322.GA7427@leeni.uk.xensource.com> References: <460C3534.8020002@galois.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <460C3534.8020002@galois.com> User-Agent: Mutt/1.5.9i X-OriginalArrivalTime: 29 Mar 2007 22:33:23.0706 (UTC) FILETIME=[42CE75A0:01C77252] X-SA-Exim-Connect-IP: 207.47.60.150 X-SA-Exim-Mail-From: ewan@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] [PATCH] Fix that makes xend tracing thread safe X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Thu, Mar 29, 2007 at 02:52:52PM -0700, Magnus Carlsson wrote:> Currently, the output in xend.trace is sometimes garbled since multiple > threads write to it simultaneously. The following patch fixes that. > > It also adds an initial field with the thread name on each traced line, > which makes it easier to follow the trace. (If this is considered a new > feature which shouldn''t be included due to the feature freeze, it can be > disabled by removing the first line in print_trace.)Applied, thanks Magnus. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Thu Mar 29 23:48:25 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Thu, 29 Mar 2007 23:48:25 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX3Pt-0001TQ-00 for Keir.Fraser@cl.cam.ac.uk; Thu, 29 Mar 2007 23:48:25 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:57396 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HX3Pa-0008EX-Bx (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Thu, 29 Mar 2007 23:48:11 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX3QK-0007SC-J9; Thu, 29 Mar 2007 22:48:52 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX3Py-0007A4-7p for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 22:48:30 +0000 Received: from 207.47.60.150.static.nextweb.net ([207.47.60.150] helo=webmail.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HX3Pv-0003Iy-Ib for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 22:48:28 +0000 Received: from leeni.uk.xensource.com ([172.31.0.52]) by webmail.xensource.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 14:47:16 -0800 Received: from emellor by leeni.uk.xensource.com with local (Exim 4.50) id 1HX3Ol-00022Q-Ap; Thu, 29 Mar 2007 23:47:15 +0100 Date: Thu, 29 Mar 2007 23:47:15 +0100 From: Ewan Mellor <ewan@xensource.com> To: Jim Fehlig <jfehlig@novell.com> Message-ID: <20070329224715.GC7427@leeni.uk.xensource.com> References: <45F740D5.8090708@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45F740D5.8090708@novell.com> User-Agent: Mutt/1.5.9i X-OriginalArrivalTime: 29 Mar 2007 22:47:16.0456 (UTC) FILETIME=[332A0680:01C77254] X-SA-Exim-Connect-IP: 207.47.60.150 X-SA-Exim-Mail-From: ewan@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] [PATCH][Xend] Fix disappearance of managed hvm domains on xend restart X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Tue, Mar 13, 2007 at 06:24:53PM -0600, Jim Fehlig wrote:> With c/s 14341, I noticed that managed HVM domains are not displayed by > ''xm list'' after restarting xend. When restarting xend and consequently > reading the managed domain config files, parsing fails on HVM domains > due to empty config items in the sexpr. So for example ''xm new > hvm_config_file'' results in the following snippet from > /var/lib/xend/domains/<uuid>/config.sxp: > > (platform > ((fda ) > (vncunused 1) > (fdb ) > > When xend is restarted and the various config files read/parsed, it > cannot cope with the config items containing no values (e.g. fda or fdb > above). > > This patch prevents writing the config items when their values are > empty. Perhaps there is a more appropriate fix but this patch corrects > the described behavior.Applied, thank you, and sorry for the delay. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 00:03:45 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 00:03:45 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX3ei-0003qo-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 00:03:44 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:40394 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HX3eR-0005sn-9o (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 00:03:32 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX3fB-0007pT-Sc; Thu, 29 Mar 2007 23:04:13 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX3ei-0007XA-NK; Thu, 29 Mar 2007 23:03:44 +0000 Received: from 207.47.60.150.static.nextweb.net ([207.47.60.150] helo=webmail.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HX3ec-0003Se-Qy; Thu, 29 Mar 2007 23:03:42 +0000 Received: from leeni.uk.xensource.com ([172.31.0.52]) by webmail.xensource.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 15:02:26 -0800 Received: from emellor by leeni.uk.xensource.com with local (Exim 4.50) id 1HX3dR-0002lI-E6; Fri, 30 Mar 2007 00:02:25 +0100 Date: Fri, 30 Mar 2007 00:02:24 +0100 From: Ewan Mellor <ewan@xensource.com> To: xen-devel@lists.xensource.com Message-ID: <20070329230224.GE7427@leeni.uk.xensource.com> References: <200703281710.l2SHACfC014440@xenbits2.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200703281710.l2SHACfC014440@xenbits2.xensource.com> User-Agent: Mutt/1.5.9i X-OriginalArrivalTime: 29 Mar 2007 23:02:26.0528 (UTC) FILETIME=[519BFE00:01C77256] X-SA-Exim-Connect-IP: 207.47.60.150 X-SA-Exim-Mail-From: ewan@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,INFO_TLD,URI_NOVOWEL autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-changelog@lists.xensource.com Subject: [Xen-devel] Re: [Xen-changelog] [xen-unstable] Added HTTPS support to Xend. There are new configuration options for the X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com The patch below was almost wholly based on work by Alastair Tse. Apologies to him for not crediting him in the changeset comment. Ewan. On Wed, Mar 28, 2007 at 10:10:11AM -0700, Xen patchbot-unstable wrote:> # HG changeset patch > # User Ewan Mellor <ewan@xensource.com> > # Date 1175034181 -3600 > # Node ID 966c65f0ddba39d45c34480a9395d828028cda26 > # Parent 94b873fb033a3ba7b7f991d389bce8caa49d43e9 > Added HTTPS support to Xend. There are new configuration options for the > Xen-API and legacy XML-RPC servers to set key and certificate files, and > xm simply needs to be configured use an https rather than an http URL. > > Signed-off-by: Ewan Mellor <ewan@xensource.com> > --- > tools/examples/xend-config.sxp | 14 +++ > tools/python/xen/util/xmlrpcclient.py | 30 ++++++ > tools/python/xen/xend/XendOptions.py | 8 + > tools/python/xen/xend/server/SSLXMLRPCServer.py | 103 ++++++++++++++++++++++++ > tools/python/xen/xend/server/SrvServer.py | 83 ++++++++++++------- > tools/python/xen/xend/server/XMLRPCServer.py | 51 ++++++++++- > 6 files changed, 249 insertions(+), 40 deletions(-) > > diff -r 94b873fb033a -r 966c65f0ddba tools/examples/xend-config.sxp > --- a/tools/examples/xend-config.sxp Tue Mar 27 23:03:32 2007 +0100 > +++ b/tools/examples/xend-config.sxp Tue Mar 27 23:23:01 2007 +0100 > @@ -46,6 +46,11 @@ > # (xen-api-server ((9363 pam ''^localhost$ example\\.com$'') > # (unix none))) > # > +# Optionally, the TCP Xen-API server can use SSL by specifying the private > +# key and certificate location: > +# > +# (9367 pam '''' /etc/xen/xen-api.key /etc/xen/xen-api.crt) > +# > # Default: > # (xen-api-server ((unix))) > > @@ -59,10 +64,17 @@ > > #(xend-unix-path /var/lib/xend/xend-socket) > > -# Address and port xend should use for the TCP XMLRPC interface, > + > +# Address and port xend should use for the legacy TCP XMLRPC interface, > # if xen-tcp-xmlrpc-server is set. > #(xen-tcp-xmlrpc-server-address ''localhost'') > #(xen-tcp-xmlrpc-server-port 8006) > + > +# SSL key and certificate to use for the legacy TCP XMLRPC interface. > +# Setting these will mean that this port serves only SSL connections as > +# opposed to plaintext ones. > +#(xend-tcp-xmlrpc-server-ssl-key-file /etc/xen/xmlrpc.key) > +#(xend-tcp-xmlrpc-server-ssl-cert-file /etc/xen/xmlrpc.crt) > > > # Port xend should use for the HTTP interface, if xend-http-server is set. > diff -r 94b873fb033a -r 966c65f0ddba tools/python/xen/util/xmlrpcclient.py > --- a/tools/python/xen/util/xmlrpcclient.py Tue Mar 27 23:03:32 2007 +0100 > +++ b/tools/python/xen/util/xmlrpcclient.py Tue Mar 27 23:23:01 2007 +0100 > @@ -30,7 +30,6 @@ except ImportError: > # SSHTransport is disabled on Python <2.4, because it uses the subprocess > # package. > ssh_enabled = False > - > > > # A new ServerProxy that also supports httpu urls. An http URL comes in the > @@ -57,6 +56,33 @@ class UnixTransport(xmlrpclib.Transport) > return HTTPUnix(self.__handler) > > > +# We need our own transport for HTTPS, because xmlrpclib.SafeTransport is > +# broken -- it does not handle ERROR_ZERO_RETURN properly. > +class HTTPSTransport(xmlrpclib.SafeTransport): > + def _parse_response(self, file, sock): > + p, u = self.getparser() > + while 1: > + try: > + if sock: > + response = sock.recv(1024) > + else: > + response = file.read(1024) > + except socket.sslerror, exn: > + if exn[0] == socket.SSL_ERROR_ZERO_RETURN: > + break > + raise > + > + if not response: > + break > + if self.verbose: > + print ''body:'', repr(response) > + p.feed(response) > + > + file.close() > + p.close() > + return u.close() > + > + > # See xmlrpclib2.TCPXMLRPCServer._marshalled_dispatch. > def conv_string(x): > if isinstance(x, StringTypes): > @@ -75,6 +101,8 @@ class ServerProxy(xmlrpclib.ServerProxy) > if protocol == ''httpu'': > uri = ''http:'' + rest > transport = UnixTransport() > + elif protocol == ''https'': > + transport = HTTPSTransport() > elif protocol == ''ssh'': > global ssh_enabled > if ssh_enabled: > diff -r 94b873fb033a -r 966c65f0ddba tools/python/xen/xend/XendOptions.py > --- a/tools/python/xen/xend/XendOptions.py Tue Mar 27 23:03:32 2007 +0100 > +++ b/tools/python/xen/xend/XendOptions.py Tue Mar 27 23:23:01 2007 +0100 > @@ -165,7 +165,13 @@ class XendOptions: > > def get_xend_tcp_xmlrpc_server_address(self): > return self.get_config_string("xend-tcp-xmlrpc-server-address", > - self.xend_tcp_xmlrpc_server_address_default) > + self.xend_tcp_xmlrpc_server_address_default) > + > + def get_xend_tcp_xmlrpc_server_ssl_key_file(self): > + return self.get_config_string("xend-tcp-xmlrpc-server-ssl-key-file") > + > + def get_xend_tcp_xmlrpc_server_ssl_cert_file(self): > + return self.get_config_string("xend-tcp-xmlrpc-server-ssl-cert-file") > > def get_xend_unix_xmlrpc_server(self): > return self.get_config_bool("xend-unix-xmlrpc-server", > diff -r 94b873fb033a -r 966c65f0ddba tools/python/xen/xend/server/SSLXMLRPCServer.py > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tools/python/xen/xend/server/SSLXMLRPCServer.py Tue Mar 27 23:23:01 2007 +0100 > @@ -0,0 +1,103 @@ > +#===========================================================================> +# This library is free software; you can redistribute it and/or > +# modify it under the terms of version 2.1 of the GNU Lesser General Public > +# License as published by the Free Software Foundation. > +# > +# This library is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +# Lesser General Public License for more details. > +# > +# You should have received a copy of the GNU Lesser General Public > +# License along with this library; if not, write to the Free Software > +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +#===========================================================================> +# Copyright (C) 2007 XenSource Inc. > +#===========================================================================> + > + > +""" > +HTTPS wrapper for an XML-RPC server interface. Requires PyOpenSSL (Debian > +package python-pyopenssl). > +""" > + > +import socket > + > +from OpenSSL import SSL > + > +from xen.util.xmlrpclib2 import XMLRPCRequestHandler, TCPXMLRPCServer > + > + > +class SSLXMLRPCRequestHandler(XMLRPCRequestHandler): > + def setup(self): > + self.connection = self.request > + self.rfile = socket._fileobject(self.request, "rb", self.rbufsize) > + self.wfile = socket._fileobject(self.request, "wb", self.wbufsize) > + > +# > +# Taken from pyOpenSSL-0.6 examples (public-domain) > +# > + > +class SSLWrapper: > + """ > + """ > + def __init__(self, conn): > + """ > + Connection is not yet a new-style class, > + so I''m making a proxy instead of subclassing. > + """ > + self.__dict__["conn"] = conn > + def __getattr__(self, name): > + return getattr(self.__dict__["conn"], name) > + def __setattr__(self, name, value): > + setattr(self.__dict__["conn"], name, value) > + > + def close(self): > + self.shutdown() > + return self.__dict__["conn"].close() > + > + def shutdown(self, how=1): > + """ > + SimpleXMLRpcServer.doPOST calls shutdown(1), > + and Connection.shutdown() doesn''t take > + an argument. So we just discard the argument. > + """ > + # Block until the shutdown is complete > + self.__dict__["conn"].shutdown() > + self.__dict__["conn"].shutdown() > + > + def accept(self): > + """ > + This is the other part of the shutdown() workaround. > + Since servers create new sockets, we have to infect > + them with our magic. :) > + """ > + c, a = self.__dict__["conn"].accept() > + return (SSLWrapper(c), a) > + > +# > +# End of pyOpenSSL-0.6 example code. > +# > + > +class SSLXMLRPCServer(TCPXMLRPCServer): > + def __init__(self, addr, allowed, xenapi, logRequests = 1, > + ssl_key_file = None, ssl_cert_file = None): > + > + TCPXMLRPCServer.__init__(self, addr, allowed, xenapi, > + SSLXMLRPCRequestHandler, logRequests) > + > + if not ssl_key_file or not ssl_cert_file: > + raise ValueError("SSLXMLRPCServer requires ssl_key_file " > + "and ssl_cert_file to be set.") > + > + # make a SSL socket > + ctx = SSL.Context(SSL.SSLv23_METHOD) > + ctx.set_options(SSL.OP_NO_SSLv2) > + ctx.use_privatekey_file (ssl_key_file) > + ctx.use_certificate_file(ssl_cert_file) > + self.socket = SSLWrapper(SSL.Connection(ctx, > + socket.socket(self.address_family, > + self.socket_type))) > + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) > + self.server_bind() > + self.server_activate() > diff -r 94b873fb033a -r 966c65f0ddba tools/python/xen/xend/server/SrvServer.py > --- a/tools/python/xen/xend/server/SrvServer.py Tue Mar 27 23:03:32 2007 +0100 > +++ b/tools/python/xen/xend/server/SrvServer.py Tue Mar 27 23:23:01 2007 +0100 > @@ -185,33 +185,49 @@ def _loadConfig(servers, root, reload): > api_cfg = xoptions.get_xen_api_server() > if api_cfg: > try: > - addrs = [(str(x[0]).split('':''), > - len(x) > 1 and x[1] or XendAPI.AUTH_PAM, > - len(x) > 2 and x[2] and map(re.compile, x[2].split(" ")) > - or None) > - for x in api_cfg] > - for addrport, auth, allowed in addrs: > - if auth not in [XendAPI.AUTH_PAM, XendAPI.AUTH_NONE]: > - log.error(''Xen-API server configuration %s is invalid, '' + > - ''as %s is not a valid authentication type.'', > - api_cfg, auth) > - break > - > - if len(addrport) == 1: > - if addrport[0] == ''unix'': > - servers.add(XMLRPCServer(auth, True, > - path = XEN_API_SOCKET, > - hosts_allowed = allowed)) > - else: > - servers.add( > - XMLRPCServer(auth, True, True, '''', > - int(addrport[0]), > - hosts_allowed = allowed)) > - else: > - addr, port = addrport > - servers.add(XMLRPCServer(auth, True, True, addr, > - int(port), > - hosts_allowed = allowed)) > + for server_cfg in api_cfg: > + # Parse the xen-api-server config > + > + host = ''localhost'' > + port = 0 > + use_tcp = False > + ssl_key_file = None > + ssl_cert_file = None > + auth_method = XendAPI.AUTH_NONE > + hosts_allowed = None > + > + host_addr = server_cfg[0].split('':'', 1) > + if len(host_addr) == 1 and host_addr[0].lower() == ''unix'': > + use_tcp = False > + elif len(host_addr) == 1: > + use_tcp = True > + port = int(host_addr[0]) > + elif len(host_addr) == 2: > + use_tcp = True > + host = str(host_addr[0]) > + port = int(host_addr[1]) > + > + if len(server_cfg) > 1: > + if server_cfg[1] in [XendAPI.AUTH_PAM, XendAPI.AUTH_NONE]: > + auth_method = server_cfg[1] > + > + if len(server_cfg) > 2: > + hosts_allowed = server_cfg[2] or None > + > + > + if len(server_cfg) > 4: > + # SSL key and cert file > + ssl_key_file = server_cfg[3] > + ssl_cert_file = server_cfg[4] > + > + > + servers.add(XMLRPCServer(auth_method, True, use_tcp = use_tcp, > + ssl_key_file = ssl_key_file, > + ssl_cert_file = ssl_cert_file, > + host = host, port = port, > + path = XEN_API_SOCKET, > + hosts_allowed = hosts_allowed)) > + > except (ValueError, TypeError), exn: > log.exception(''Xen API Server init failed'') > log.error(''Xen-API server configuration %s is invalid.'', api_cfg) > @@ -219,8 +235,17 @@ def _loadConfig(servers, root, reload): > if xoptions.get_xend_tcp_xmlrpc_server(): > addr = xoptions.get_xend_tcp_xmlrpc_server_address() > port = xoptions.get_xend_tcp_xmlrpc_server_port() > - servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False, use_tcp = True, > - host = addr, port = port)) > + ssl_key_file = xoptions.get_xend_tcp_xmlrpc_server_ssl_key_file() > + ssl_cert_file = xoptions.get_xend_tcp_xmlrpc_server_ssl_cert_file() > + > + if ssl_key_file and ssl_cert_file: > + servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False, use_tcp = True, > + ssl_key_file = ssl_key_file, > + ssl_cert_file = ssl_cert_file, > + host = addr, port = port)) > + else: > + servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False, use_tcp = True, > + host = addr, port = port)) > > if xoptions.get_xend_unix_xmlrpc_server(): > servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False)) > diff -r 94b873fb033a -r 966c65f0ddba tools/python/xen/xend/server/XMLRPCServer.py > --- a/tools/python/xen/xend/server/XMLRPCServer.py Tue Mar 27 23:03:32 2007 +0100 > +++ b/tools/python/xen/xend/server/XMLRPCServer.py Tue Mar 27 23:23:01 2007 +0100 > @@ -21,6 +21,11 @@ import types > import types > import xmlrpclib > from xen.util.xmlrpclib2 import UnixXMLRPCServer, TCPXMLRPCServer > +try: > + from SSLXMLRPCServer import SSLXMLRPCServer > + ssl_enabled = True > +except ImportError: > + ssl_enabled = False > > from xen.xend import XendAPI, XendDomain, XendDomainInfo, XendNode > from xen.xend import XendLogging, XendDmesg > @@ -87,14 +92,20 @@ exclude = [''domain_create'', ''domain_rest > exclude = [''domain_create'', ''domain_restore''] > > class XMLRPCServer: > - def __init__(self, auth, use_xenapi, use_tcp=False, host = "localhost", > - port = 8006, path = XML_RPC_SOCKET, hosts_allowed = None): > + def __init__(self, auth, use_xenapi, use_tcp = False, > + ssl_key_file = None, ssl_cert_file = None, > + host = "localhost", port = 8006, path = XML_RPC_SOCKET, > + hosts_allowed = None): > + > self.use_tcp = use_tcp > self.port = port > self.host = host > self.path = path > self.hosts_allowed = hosts_allowed > > + self.ssl_key_file = ssl_key_file > + self.ssl_cert_file = ssl_cert_file > + > self.ready = False > self.running = True > self.auth = auth > @@ -107,14 +118,33 @@ class XMLRPCServer: > > try: > if self.use_tcp: > - log.info("Opening TCP XML-RPC server on %s%d%s", > + using_ssl = self.ssl_key_file and self.ssl_cert_file > + > + log.info("Opening %s XML-RPC server on %s%d%s", > + using_ssl and ''HTTPS'' or ''TCP'', > self.host and ''%s:'' % self.host or > ''all interfaces, port '', > self.port, authmsg) > - self.server = TCPXMLRPCServer((self.host, self.port), > - self.hosts_allowed, > - self.xenapi is not None, > - logRequests = False) > + > + if not ssl_enabled: > + raise ValueError("pyOpenSSL not installed. " > + "Unable to start HTTPS XML-RPC server") > + > + if using_ssl: > + self.server = SSLXMLRPCServer( > + (self.host, self.port), > + self.hosts_allowed, > + self.xenapi is not None, > + logRequests = False, > + ssl_key_file = self.ssl_key_file, > + ssl_cert_file = self.ssl_cert_file) > + else: > + self.server = TCPXMLRPCServer( > + (self.host, self.port), > + self.hosts_allowed, > + self.xenapi is not None, > + logRequests = False) > + > else: > log.info("Opening Unix domain socket XML-RPC server on %s%s", > self.path, authmsg) > @@ -126,7 +156,12 @@ class XMLRPCServer: > ready = True > running = False > return > - > + except Exception, e: > + log.exception(''Cannot start server: %s!'', e) > + ready = True > + running = False > + return > + > # Register Xen API Functions > # ------------------------------------------------------------------- > # exportable functions are ones that do not begin with ''_'' > > _______________________________________________ > Xen-changelog mailing list > Xen-changelog@lists.xensource.com > http://lists.xensource.com/xen-changelog_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 00:26:22 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 00:26:22 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX40c-0002OT-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 00:26:22 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:49259 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HX3zo-0004zB-OK (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 00:25:38 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX40Y-0008QU-0g; Thu, 29 Mar 2007 23:26:18 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX40A-000885-EF for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 23:25:54 +0000 Received: from e2.ny.us.ibm.com ([32.97.182.142]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX405-0003gj-Ib for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 23:25:52 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2TNOZ0I028563 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 19:24:35 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2TNOZpL307292 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 19:24:35 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2TNOZkL006798 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 19:24:35 -0400 Received: from [9.49.130.214] (sig-9-49-130-214.mts.ibm.com [9.49.130.214]) by d01av04.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2TNOVbm006724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Mar 2007 19:24:34 -0400 Message-ID: <460C4AAE.5020707@us.ibm.com> Date: Thu, 29 Mar 2007 18:24:30 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: "Kamble, Nitin A" <nitin.a.kamble@intel.com> References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> In-Reply-To: <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.182.142 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Hi Nitin, Thanks for trying out the patch Kamble, Nitin A wrote:> Hi Anthony, > I tried your patch at my end with snapshot of xen-unstable on > 20070326. And here are my findings. > - The --emulate-16bit option for qemu did not work. qemu is not > accepting this as an valid command line option.Perhaps you did --emulate-16bit instead of -emulate-16bit? The patch definitely has the added option.> - I tried hardcoding this to 1 in the qemu code, and found that the > port x595 is not reflecting it correctly to hvmloader.Are you sure you don''t have something stale?> - Then I tried forcing in the hvmloader to use the emulator instead > of vmxassit, and I see the the emulator is not getting the right > context. Following is the console log at this point. > > (XEN) HVM3: HVM > Loader > (XEN) HVM3: Detected Xen > v3.0-unstable > (XEN) HVM3: Writing SMBIOS tables > ... > (XEN) HVM3: Loading ROMBIOS > ... > (XEN) irq.c:210: Dom3 PCI link 0 changed 0 -> > 5 > (XEN) HVM3: PCI-ISA link 0 routed to > IRQ5 > (XEN) irq.c:210: Dom3 PCI link 1 changed 0 -> > 7 > (XEN) HVM3: PCI-ISA link 1 routed to > IRQ7 > (XEN) irq.c:210: Dom3 PCI link 2 changed 0 -> > 10 > (XEN) HVM3: PCI-ISA link 2 routed to > IRQ10 > (XEN) irq.c:210: Dom3 PCI link 3 changed 0 -> > 11 > (XEN) HVM3: PCI-ISA link 3 routed to > IRQ11 > (XEN) HVM3: pci dev 01:1 bar 20 size 00000010: > 0000c001 > (XEN) HVM3: pci dev 01:2 > INTA->IRQ7 > (XEN) HVM3: pci dev 02:0 bar 10 size 02000000: > f0000008 > (XEN) HVM3: pci dev 02:0 bar 14 size 00001000: > f2000000 > (XEN) HVM3: pci dev 03:0 bar 10 size 00000100: > 0000c101 > (XEN) HVM3: pci dev 03:0 bar 14 size 01000000: > f3000008 > (XEN) HVM3: pci dev 03:0 > INTA->IRQ11 > (XEN) HVM3: pci dev 04:0 bar 10 size 00000100: > 0000c201 > (XEN) HVM3: pci dev 04:0 bar 14 size 00000100: > f4000000 > (XEN) HVM3: pci dev 04:0 > INTA->IRQ5 > (XEN) HVM3: Creating MP tables > ... > (XEN) HVM3: Loading Cirrus VGABIOS > ... > (XEN) HVM3: Loading ACPI > ... > (XEN) HVM3: Not Loading VMXAssist ... > ffffffff > (XEN) HVM3: > foo > (XEN) > hvmop_emulate_realmode > (XEN) guest requests real mode > emulation > (XEN) foo > 221 > (XEN) HVM3: Invoking ROMBIOS > ... > (XEN) Transfering control to x86_emulate %eip > 0x0 > (XEN) hvm.c:446:d3 Triple fault on VCPU0 - invoking HVM system reset. > > The log shows that emulator is not getting the right cpu context. > How much of testing have you done with this code? I am not able to > proceed to emulation of 1 instruction with the patch. How many > instruction could you emulate with the patch?I suspect you have a partial install or something. I have never seen this happen. You should see x86_emulate run for a good number of instructions. The odd thing about your log is that the transfering control to x86_emulate message uses the EIP from the vmcs. If this is the first time the emulator is being invoked, how can eip be 0? There''s nothing in the emulate path that would touch the vmcs. How exactly are you forcing the use of the emulator instead of vmxassist? Regards, Anthony Liguori> > Thanks & Regards, > Nitin > Open Source Technology Center, Intel Corporation. > ------------------------------------------------------------------------- > The mind is like a parachute; it works much better when it''s open. > > On Sun, 2007-03-25 at 16:35 -0700, Anthony Liguori wrote: >> Howdy, >> >> Attached is a patch that begins to lay down the infrastructure for >> emulating real mode with x86_emulate(). With a little more refactoring, >> I think it could also replace the SVM emulator. >> >> The patch introduces an HVMOP hypercall to set a flag in the hvm vcpu >> struct to signal that real mode should be emulated with x86_emulate >> instead of using vm86. This is to make development a little bit easier >> since x86_emulate is not quite there yet wrt 16 bit emulation. It can >> be enabled by passing -emulate-16bit to qemu-dm (I use a wrapper script >> similar to qemu-dm.debug). >> >> The VT code keeps track of the whether it''s in the emulator and loops on >> the do_resume path in x86_emulate. I think this code probably should be >> refactored into the common HVM code although this would require changing >> some of the HVM ops. This would allow SVM to use the x86_emulate to >> handle individual instructions. >> >> There are some issues to work out. Namely, x86_emulate appears to want >> blocking PIO calls which isn''t conducive to the wait PIO works today in >> HVM. This is only a problem for instructions at the moment. I''m also a >> bit confused about how to properly loop in the emulator. schedule_tail >> is not meant to return so perhaps we should loop on emulating == 1 >> instead of hypercall_preempt_check? I didn''t think the hypervisor was >> preemptable though. >> >> The current code doesn''t handle non-flat segments as I don''t think >> hvm_copy_from/to_guest handles it (which I assume it would need to). >> >> However, it is enough to start running instructions in x86_emulate so >> it''s enough to start working on enhancing that. >> >> Regards, >> >> Anthony Liguori >> >> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 00:54:17 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 00:54:17 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX4Rd-0003EF-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 00:54:17 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.255, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:42454 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HX4R6-0002Xl-UJ (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 00:53:49 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX4Rq-0001Cp-Sr; Thu, 29 Mar 2007 23:54:30 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX4RS-0000ud-QY for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 23:54:06 +0000 Received: from mga02.intel.com ([134.134.136.20]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX4RP-0003rx-SN for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 23:54:04 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 29 Mar 2007 16:52:50 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2007 16:52:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,348,1170662400"; d="asc''?scan''208,217"; a="218896707:sNHT39770794" Received: from scsmsx412.amr.corp.intel.com ([10.3.90.31]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 16:52:43 -0700 Received: from 143.183.140.150 ([143.183.140.150]) by scsmsx412.amr.corp.intel.com ([10.3.90.31]) via Exchange Front-End Server email.intel.com ([192.168.65.22]) with Microsoft Exchange Server HTTP-DAV ; Thu, 29 Mar 2007 23:52:43 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Received: from lnitindesktop by email.intel.com; 29 Mar 2007 16:52:43 -0700 Content-class: urn:content-classes:message Date: Thu, 29 Mar 2007 16:52:42 -0700 Message-ID: <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> In-Reply-To: <460C4AAE.5020707@us.ibm.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH][RFC] Emulating real mode with x86_emulate Thread-Index: AcdyXVex34nR5IlETgSNwDrUQJKk3Q=References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> From: "Kamble, Nitin A" <nitin.a.kamble@intel.com> To: "Anthony Liguori" <aliguori@us.ibm.com> X-OriginalArrivalTime: 29 Mar 2007 23:52:43.0687 (UTC) FILETIME=[57F9EB70:01C7725D] X-SA-Exim-Connect-IP: 134.134.136.20 X-SA-Exim-Mail-From: nitin.a.kamble@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,HTML_40_50, HTML_MESSAGE,RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0000139222==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --===============0000139222=Content-Type: multipart/signed; boundary="=-yuO8hO8CQSPTXwp0Rls/"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-yuO8hO8CQSPTXwp0Rls/ Content-Type: multipart/alternative; boundary="=-RRN3wrXtYLnin7gp7RIh" --=-RRN3wrXtYLnin7gp7RIh Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Anthony,> Perhaps you did --emulate-16bit instead of -emulate-16bit? The patch=20 > definitely has the added option. >=20You are right, it was -emulate-16bit.> > - I tried hardcoding this to 1 in the qemu code, and found that the=20 > > port x595 is not reflecting it correctly to hvmloader. >=20 > Are you sure you don''t have something stale?I started with a fresh tree for your patch. I also tried rebuilding the quemu from start.> I suspect you have a partial install or something. I have never seen=20 > this happen.I have already tried few times. i will try one more time with newer fresh xen-unstable tree. Some of the debug messages were coming from my prinks.>=20 > You should see x86_emulate run for a good number of instructions. The=20 > odd thing about your log is that the transfering control to x86_emulate=20 > message uses the EIP from the vmcs. If this is the first time the=20 > emulator is being invoked, how can eip be 0? There''s nothing in the=20 > emulate path that would touch the vmcs. >=20 > How exactly are you forcing the use of the emulator instead of vmxassist? >=20I basically forced emulate_16bit varilable in qemu to 1.=20 int acpi_enabled =3D 0; int fd_bootchk =3D 1; int emulate_16bit =3D 1; and in the hvmloader instead of checking the output of the port 595, I replaced it with if (1). like this: #if 0 if (inl(0x595) =3D=3D 0xdeadbeef) { #else if (1) { #endif Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it''s open.=20 --=-RRN3wrXtYLnin7gp7RIh Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8"> <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.3"> </HEAD> <BODY> Hi Anthony, <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">Perhaps you did --emulate-16bit instead of -emulate-16bit? The patch </FONT> <FONT COLOR=3D"#000000">definitely has the added option.</FONT> </PRE> </BLOCKQUOTE> You are right, it was -emulate-16bit.<BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">> - I tried hardcoding this to 1 in the qemu code, and found that the </FONT> <FONT COLOR=3D"#000000">> port x595 is not reflecting it correctly to hvmloader.</FONT> <FONT COLOR=3D"#000000">Are you sure you don''t have something stale?</FONT> </PRE> </BLOCKQUOTE> I started with a fresh tree for your patch. I also tried rebuilding the quemu from start. <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">I suspect you have a partial install or something. I have never seen </FONT> <FONT COLOR=3D"#000000">this happen.</FONT> </PRE> </BLOCKQUOTE> I have already tried few times. i will try one more time with newer fresh xen-unstable tree. Some of the debug messages were coming from my prinks. <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">You should see x86_emulate run for a good number of instructions. The </FONT> <FONT COLOR=3D"#000000">odd thing about your log is that the transfering control to x86_emulate </FONT> <FONT COLOR=3D"#000000">message uses the EIP from the vmcs. If this is the first time the </FONT> <FONT COLOR=3D"#000000">emulator is being invoked, how can eip be 0? There''s nothing in the </FONT> <FONT COLOR=3D"#000000">emulate path that would touch the vmcs.</FONT> <FONT COLOR=3D"#000000">How exactly are you forcing the use of the emulator instead of vmxassist?</FONT> </PRE> </BLOCKQUOTE> I basically forced emulate_16bit varilable in qemu to 1. <BR> <BR> int acpi_enabled =3D 0;<BR> int fd_bootchk =3D 1;<BR> int emulate_16bit<B> =3D 1;</B><BR> <BR> and in the hvmloader instead of checking the output of the port 595, I replaced it with if (1).<BR> like this:<BR> #if 0<BR> if (inl(0x595) =3D=3D 0xdeadbeef) {<BR> #else<BR> <B> if (1) {</B><BR> #endif<BR> <BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> </BODY> </HTML> --=-RRN3wrXtYLnin7gp7RIh-- --=-yuO8hO8CQSPTXwp0Rls/ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGDFFKZ1sfU7kTCR8RAhdTAJ99pMjCRV8E/VZeXcaTakErBVBrygCdFsiU dc6mAiYXFyJw9rzKttlsFr8=htK9 -----END PGP SIGNATURE----- --=-yuO8hO8CQSPTXwp0Rls/-- --===============0000139222=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0000139222==-- From xen-devel-bounces.xensource.com Fri Mar 30 01:13:14 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 01:13:14 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX4jy-0003bS-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 01:13:14 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:41688 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HX4jl-0000ez-9g (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 01:13:06 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX4kV-0001b0-A3; Fri, 30 Mar 2007 00:13:47 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX4k9-0001Iz-Og for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 00:13:25 +0000 Received: from e2.ny.us.ibm.com ([32.97.182.142]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX4k6-0003um-WE for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 00:13:23 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2U0CBLO007952 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 20:12:11 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2U0CBL8282902 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 20:12:11 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2U0CBmd025473 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 20:12:11 -0400 Received: from [9.49.130.214] (sig-9-49-130-214.mts.ibm.com [9.49.130.214]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2U0Bf12024815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Mar 2007 20:12:10 -0400 Message-ID: <460C55BD.5050202@us.ibm.com> Date: Thu, 29 Mar 2007 19:11:41 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: "Kamble, Nitin A" <nitin.a.kamble@intel.com> References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> In-Reply-To: <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.182.142 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Kamble, Nitin A wrote:> Hi Anthony, >> Perhaps you did --emulate-16bit instead of -emulate-16bit? The patch >> definitely has the added option. >> >> > You are right, it was -emulate-16bit. > >> > - I tried hardcoding this to 1 in the qemu code, and found that the >> > port x595 is not reflecting it correctly to hvmloader. >> >> Are you sure you don''t have something stale? >> > I started with a fresh tree for your patch. I also tried rebuilding > the quemu from start.Okay, you''ll need to make sure that hvmloader and qemu are both being rebuilt and reinstalled.>> I suspect you have a partial install or something. I have never seen >> this happen. >> > I have already tried few times. i will try one more time with newer > fresh xen-unstable tree. Some of the debug messages were coming from > my prinks. >> You should see x86_emulate run for a good number of instructions. The >> odd thing about your log is that the transfering control to x86_emulate >> message uses the EIP from the vmcs. If this is the first time the >> emulator is being invoked, how can eip be 0? There''s nothing in the >> emulate path that would touch the vmcs. >> >> How exactly are you forcing the use of the emulator instead of vmxassist? >> >> > I basically forced emulate_16bit varilable in qemu to 1. > > int acpi_enabled = 0; > int fd_bootchk = 1; > int emulate_16bit* = 1;* > > and in the hvmloader instead of checking the output of the port 595, I > replaced it with if (1). > like this: > #if 0 > if (inl(0x595) == 0xdeadbeef) { > #else > * if (1) {* > #endifThe really curious thing is that eip from the VMCS is set to 0. eip should be address of the EIP of whatever movl cr0 instruction that occurs when returning from main() in hvmloader. I guess it''s possible that if you are using a version of unstable that predates Keir''s recent hvmloader changes, you wouldn''t have hvmloader switching to real mode. That could explain some of the weirdness you''re seeing. What changeset are you on? Regards, Anthony Liguori> > Thanks & Regards, > Nitin > Open Source Technology Center, Intel Corporation. > ------------------------------------------------------------------------- > The mind is like a parachute; it works much better when it''s open. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 02:01:00 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 02:01:00 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX5UC-0004Po-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 02:01:00 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.255, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:58993 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HX5Tm-0008OB-FM (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 02:00:39 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX5UW-0002B2-Pa; Fri, 30 Mar 2007 01:01:20 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX5U9-0001so-13 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 01:00:57 +0000 Received: from mga02.intel.com ([134.134.136.20]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX5U6-0004Gb-4Q for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 01:00:54 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 29 Mar 2007 17:59:43 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2007 17:59:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,350,1170662400"; d="asc''?scan''208,217"; a="218932985:sNHT39922554" Received: from scsmsx412.amr.corp.intel.com ([10.3.90.31]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 17:59:42 -0700 Received: from 143.183.140.150 ([143.183.140.150]) by scsmsx412.amr.corp.intel.com ([10.3.90.31]) via Exchange Front-End Server email.intel.com ([192.168.65.22]) with Microsoft Exchange Server HTTP-DAV ; Fri, 30 Mar 2007 00:59:42 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Received: from lnitindesktop by email.intel.com; 29 Mar 2007 17:59:41 -0700 Content-class: urn:content-classes:message Date: Thu, 29 Mar 2007 17:59:41 -0700 Message-ID: <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> In-Reply-To: <460C55BD.5050202@us.ibm.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH][RFC] Emulating real mode with x86_emulate Thread-Index: AcdyZrMcdlP0vJxOTyyEoT1MY/udcA=References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> From: "Kamble, Nitin A" <nitin.a.kamble@intel.com> To: "Anthony Liguori" <aliguori@us.ibm.com> X-OriginalArrivalTime: 30 Mar 2007 00:59:42.0572 (UTC) FILETIME=[B36B1AC0:01C77266] X-SA-Exim-Connect-IP: 134.134.136.20 X-SA-Exim-Mail-From: nitin.a.kamble@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,HTML_40_50, HTML_MESSAGE,RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0692476531==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --===============0692476531=Content-Type: multipart/signed; boundary="=-J01OaSuAjKQqMf6uzkn9"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-J01OaSuAjKQqMf6uzkn9 Content-Type: multipart/alternative; boundary="=-eI9t/0Mgr9h+RlSUXEO5" --=-eI9t/0Mgr9h+RlSUXEO5 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2007-03-29 at 19:11 -0500, Anthony Liguori wrote:> Okay, you''ll need to make sure that hvmloader and qemu are both being=20 > rebuilt and reinstalled. >=20I am sure both are built with the patch and installed correctly.> The really curious thing is that eip from the VMCS is set to 0. eip=20 > should be address of the EIP of whatever movl cr0 instruction that=20 > occurs when returning from main() in hvmloader. >=20I also find that x86_emulate() is never called while emulate_realmode is set in the hypervisor.=20> I guess it''s possible that if you are using a version of unstable that=20 > predates Keir''s recent hvmloader changes, you wouldn''t have hvmloader=20 > switching to real mode. That could explain some of the weirdness you''re=20 > seeing. What changeset are you on?So far I am using: r14560_20070326 Now I am trying with: r14631_20070329 Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it''s open.=20 --=-eI9t/0Mgr9h+RlSUXEO5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8"> <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.3"> </HEAD> <BODY> On Thu, 2007-03-29 at 19:11 -0500, Anthony Liguori wrote:<BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">Okay, you''ll need to make sure that hvmloader and qemu are both being </FONT> <FONT COLOR=3D"#000000">rebuilt and reinstalled.</FONT> </PRE> </BLOCKQUOTE> I am sure both are built with the patch and installed correctly.<BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">The really curious thing is that eip from the VMCS is set to 0. eip </FONT> <FONT COLOR=3D"#000000">should be address of the EIP of whatever movl cr0 instruction that </FONT> <FONT COLOR=3D"#000000">occurs when returning from main() in hvmloader.</FONT> </PRE> </BLOCKQUOTE> I also find that x86_emulate() is never called while emulate_realmode is set in the hypervisor. <BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">I guess it''s possible that if you are using a version of unstable that </FONT> <FONT COLOR=3D"#000000">predates Keir''s recent hvmloader changes, you wouldn''t have hvmloader </FONT> <FONT COLOR=3D"#000000">switching to real mode. That could explain some of the weirdness you''re </FONT> <FONT COLOR=3D"#000000">seeing. What changeset are you on</FONT>? </PRE> </BLOCKQUOTE> So far I am using: r14560_20070326<BR> <BR> Now I am trying with: r14631_20070329<BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> </BODY> </HTML> --=-eI9t/0Mgr9h+RlSUXEO5-- --=-J01OaSuAjKQqMf6uzkn9 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGDGD9Z1sfU7kTCR8RAhixAJ4qwccgvbMgGYGakM5ib1AnJh+EWgCdHkO+ KZFavRmbkqWLAWzq7Bp0Zec=fHjg -----END PGP SIGNATURE----- --=-J01OaSuAjKQqMf6uzkn9-- --===============0692476531=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0692476531==-- From xen-devel-bounces.xensource.com Fri Mar 30 03:19:16 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 03:19:16 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX6hw-0007N0-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 03:19:16 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:42989 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HX6hh-0005qf-F9 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 03:19:06 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX6iS-00045v-I5; Fri, 30 Mar 2007 02:19:48 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX6i7-0003oJ-Ak for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 02:19:27 +0000 Received: from mga02.intel.com ([134.134.136.20]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX6i2-0004ec-Cy for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 02:19:25 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 29 Mar 2007 19:18:11 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2007 19:18:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,350,1170662400"; d="scan''208"; a="218964382:sNHT93543933" Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 19:17:53 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Mar 2007 10:17:47 +0800 Message-ID: <B30DA1341B0CFA4893EF8A36B40B5C5DF22629@pdsmsx411.ccr.corp.intel.com> In-Reply-To: <C231C15A.C8C2%keir@xensource.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] [PATCH] Enable VMX MSR bitmap support Thread-Index: AcdyKjZ/7APHhrjjQt+EbbWJ0G+NwgABFZSWAA6tTmAFrom: "Li, Xin B" <xin.b.li@intel.com> To: "Keir Fraser" <keir@xensource.com>, <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 30 Mar 2007 02:17:53.0680 (UTC) FILETIME=[9F896100:01C77271] X-SA-Exim-Connect-IP: 134.134.136.20 X-SA-Exim-Mail-From: xin.b.li@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] [PATCH] Enable VMX MSR bitmap support X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com> Also you got the write-low and read-high offsets into the MSR bitmapthe wrong way round!>Oops, seems you''re using an old version of Intel PRM, if you check the latest one, you can find the sequence changed, which also confused me at the beginning!!! -Xin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 03:22:01 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 03:22:01 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX6kb-0005nJ-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 03:22:01 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.255, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:44837 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HX6kO-0004c0-C7 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 03:21:54 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX6lA-0004TI-5L; Fri, 30 Mar 2007 02:22:36 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX6km-0004B7-IA for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 02:22:12 +0000 Received: from mga09.intel.com ([134.134.136.24]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX6kj-0004jY-HF for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 02:22:10 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by mga09.intel.com with ESMTP; 29 Mar 2007 19:20:34 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by fmsmga002.fm.intel.com with ESMTP; 29 Mar 2007 19:20:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,350,1170662400"; d="asc''?scan''208,217"; a="66196380:sNHT473515695" Received: from scsmsx412.amr.corp.intel.com ([10.3.90.31]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 19:20:15 -0700 Received: from 143.183.140.150 ([143.183.140.150]) by scsmsx412.amr.corp.intel.com ([10.3.90.31]) via Exchange Front-End Server email.intel.com ([192.168.65.22]) with Microsoft Exchange Server HTTP-DAV ; Fri, 30 Mar 2007 02:20:14 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Received: from lnitindesktop by email.intel.com; 29 Mar 2007 19:20:14 -0700 Content-class: urn:content-classes:message Date: Thu, 29 Mar 2007 19:20:14 -0700 Message-ID: <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> In-Reply-To: <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH][RFC] Emulating real mode with x86_emulate Thread-Index: AcdycfPE+9VxgrlySQyZjky3kdK6xw=References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> From: "Kamble, Nitin A" <nitin.a.kamble@intel.com> To: "Anthony Liguori" <aliguori@us.ibm.com> X-OriginalArrivalTime: 30 Mar 2007 02:20:15.0494 (UTC) FILETIME=[F4107A60:01C77271] X-SA-Exim-Connect-IP: 134.134.136.24 X-SA-Exim-Mail-From: nitin.a.kamble@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============1140095980==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --===============1140095980=Content-Type: multipart/signed; boundary="=-IdfmO0JkYs4JRjxwLe7u"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-IdfmO0JkYs4JRjxwLe7u Content-Type: multipart/alternative; boundary="=-WoAS16CCWjCvqH5p8oaP" --=-WoAS16CCWjCvqH5p8oaP Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Anthony, With the new revision I am able to get the -emulate-16bit command line switch working. (XEN) HVM2: Creating MP tables ... =20 (XEN) HVM2: Loading Cirrus VGABIOS ... =20 (XEN) HVM2: Loading ACPI ... =20 (XEN) HVM2: Loading VMXAssist ... deadbeef =20 (XEN) HVM2: foo =20 (XEN) hvmop_emulate_realmode =20 (XEN) guest requests real mode emulation =20 (XEN) foo 221 =20 (XEN) HVM2: Invoking ROMBIOS ... =20 (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset.=20 I have not added any debug lines in the code yet, and I don''t know how far is the emulator going. I will check it tomorrow. Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it''s open.=20 =20 On Thu, 2007-03-29 at 17:59 -0700, Nitin A Kamble wrote:> On Thu, 2007-03-29 at 19:11 -0500, Anthony Liguori wrote: >=20 >=20 > > Okay, you''ll need to make sure that hvmloader and qemu are both being=20 > > rebuilt and reinstalled. > >=20 >=20 > I am sure both are built with the patch and installed correctly. >=20 >=20 > > The really curious thing is that eip from the VMCS is set to 0. eip=20 > > should be address of the EIP of whatever movl cr0 instruction that=20 > > occurs when returning from main() in hvmloader. > >=20 >=20 > I also find that x86_emulate() is never called while emulate_realmode > is set in the hypervisor.=20 >=20 >=20 > > I guess it''s possible that if you are using a version of unstable that=20 > > predates Keir''s recent hvmloader changes, you wouldn''t have hvmloader=20 > > switching to real mode. That could explain some of the weirdness you''re=20 > > seeing. What changeset are you on? >=20 > So far I am using: r14560_20070326 >=20 > Now I am trying with: r14631_20070329 >=20 > Thanks & Regards, > Nitin=20 > Open Source Technology Center, Intel Corporation. > ------------------------------------------------------------------------- > The mind is like a parachute; it works much better when it''s open.=20--=-WoAS16CCWjCvqH5p8oaP Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8"> <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.3"> </HEAD> <BODY> Hi Anthony,<BR> With the new revision I am able to get the -emulate-16bit command line switch working.<BR> <BR> (XEN) HVM2: Creating MP tables ... <BR> (XEN) HVM2: Loading Cirrus VGABIOS ... <BR> (XEN) HVM2: Loading ACPI ... <BR> (XEN) HVM2: Loading VMXAssist ... deadbeef <BR> (XEN) HVM2: foo <BR> (XEN) hvmop_emulate_realmode <BR> (XEN) guest requests real mode emulation <BR> (XEN) foo 221 <BR> (XEN) HVM2: Invoking ROMBIOS ... <BR> (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. <BR> <BR> I have not added any debug lines in the code yet, and I don''t know how far is the emulator going. I will check it tomorrow.<BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> <BR> On Thu, 2007-03-29 at 17:59 -0700, Nitin A Kamble wrote:<BR> <BLOCKQUOTE TYPE=3DCITE> <FONT COLOR=3D"#000000">On Thu, 2007-03-29 at 19:11 -0500, Anthony Liguori wrote:</FONT><BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">Okay, you''ll need to make sure that hvmloader and qemu are both being </FONT> <FONT COLOR=3D"#000000">rebuilt and reinstalled.</FONT> </PRE> </BLOCKQUOTE> <FONT COLOR=3D"#000000">I am sure both are built with the patch and installed correctly.</FONT><BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">The really curious thing is that eip from the VMCS is set to 0. eip </FONT> <FONT COLOR=3D"#000000">should be address of the EIP of whatever movl cr0 instruction that </FONT> <FONT COLOR=3D"#000000">occurs when returning from main() in hvmloader.</FONT> </PRE> </BLOCKQUOTE> <FONT COLOR=3D"#000000">I also find that x86_emulate() is never called while emulate_realmode is set in the hypervisor. </FONT><BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">I guess it''s possible that if you are using a version of unstable that </FONT> <FONT COLOR=3D"#000000">predates Keir''s recent hvmloader changes, you wouldn''t have hvmloader </FONT> <FONT COLOR=3D"#000000">switching to real mode. That could explain some of the weirdness you''re </FONT> <FONT COLOR=3D"#000000">seeing. What changeset are you on?</FONT> </PRE> </BLOCKQUOTE> <FONT COLOR=3D"#000000">So far I am using: r14560_20070326</FONT><BR> <BR> <FONT COLOR=3D"#000000">Now I am trying with: r14631_20070329</FONT><BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> </BLOCKQUOTE> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <BR> </TD> </TR> </TABLE> </BODY> </HTML> --=-WoAS16CCWjCvqH5p8oaP-- --=-IdfmO0JkYs4JRjxwLe7u Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGDHPeZ1sfU7kTCR8RAkkjAJ9JGfd/1kB2eQMKknwMPhBvtoG3RACeJAfA mXmJ372WlknKxrfDmjj3XcA=Ainj -----END PGP SIGNATURE----- --=-IdfmO0JkYs4JRjxwLe7u-- --===============1140095980=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1140095980==-- From xen-devel-bounces.xensource.com Fri Mar 30 04:22:27 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 04:22:27 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX7h5-0006op-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 04:22:27 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:35259 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HX7ge-0005bG-Mu (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 04:22:05 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX7h2-00050N-MB; Fri, 30 Mar 2007 03:22:24 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX7gg-0004iS-C1 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:22:02 +0000 Received: from e2.ny.us.ibm.com ([32.97.182.142]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX7gd-0005Ag-Af for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:22:00 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2U3KldK026925 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 23:20:47 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2U3Kl3a283068 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 23:20:47 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2U3KlMQ009264 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 23:20:47 -0400 Received: from [9.76.206.84] (sig-9-76-206-84.mts.ibm.com [9.76.206.84]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2U3KeXE009146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Mar 2007 23:20:46 -0400 Message-ID: <460C8207.8000604@us.ibm.com> Date: Thu, 29 Mar 2007 22:20:39 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: "Kamble, Nitin A" <nitin.a.kamble@intel.com> References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> In-Reply-To: <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.182.142 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Kamble, Nitin A wrote:> Hi Anthony, > With the new revision I am able to get the -emulate-16bit command > line switch working. > > (XEN) HVM2: Creating MP tables > ... > (XEN) HVM2: Loading Cirrus VGABIOS > ... > (XEN) HVM2: Loading ACPI > ... > (XEN) HVM2: Loading VMXAssist ... > deadbeef > (XEN) HVM2: > foo > (XEN) > hvmop_emulate_realmode > (XEN) guest requests real mode > emulation > (XEN) foo > 221 > (XEN) HVM2: Invoking ROMBIOS > ... > (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset.The Triple fault you''re seeing here is terribly curious. Also the "deadbeef" output. Just to sanity check, I threw the following printk in vmcs.c while (!hypercall_preempt_check()) { + printk("eip = 0x%x\n", regs->eip); if (x86_emulate(&ctxt, &em_ops)) { And I get the following output with a FC5 guest: (XEN) hvmop_emulate_realmode (XEN) guest requests real mode emulation (XEN) foo 221 (XEN) eip = 0xd338d (XEN) eip = 0xd338e (XEN) eip = 0xffbf0000 (XEN) failed to emulate instruction at %eip = 0xd338d (XEN) domain_crash_sync called from vmcs.c:625 (XEN) Domain 1 (vcpu#0) crashed on cpu#0: (XEN) ----[ Xen-3.0-unstable x86_32 debug=n Not tainted ]---- (XEN) CPU: 0 (XEN) EIP: 0010:[<000d338d>] (XEN) EFLAGS: 00000002 CONTEXT: hvm (XEN) eax: 00000076 ebx: 000d7324 ecx: 000d7324 edx: 000000e9 (XEN) esi: 000d4e54 edi: 000d3380 ebp: 000d72a8 esp: 000d72a8 (XEN) cr0: 00050032 cr4: 00000651 cr3: 00000000 cr2: 00000000 (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0018 cs: 0010 So, perhaps it''s the guest you''re using? Clearly, we''re running in x86_emulate and hitting a 16 bit instruction we can''t handle. N.B. the printk in the error path for x86_emulate is wrong. I should be looking at regs->eip, not GUEST_RIP since that wouldn''t have been updated again. Regards, Anthony Liguori> I have not added any debug lines in the code yet, and I don''t know how > far is the emulator going. I will check it tomorrow. > > Thanks & Regards, > Nitin > Open Source Technology Center, Intel Corporation. > ------------------------------------------------------------------------- > The mind is like a parachute; it works much better when it''s open. > > > On Thu, 2007-03-29 at 17:59 -0700, Nitin A Kamble wrote: >> On Thu, 2007-03-29 at 19:11 -0500, Anthony Liguori wrote: >> >>> Okay, you''ll need to make sure that hvmloader and qemu are both being >>> rebuilt and reinstalled. >>> >>> >> I am sure both are built with the patch and installed correctly. >> >>> The really curious thing is that eip from the VMCS is set to 0. eip >>> should be address of the EIP of whatever movl cr0 instruction that >>> occurs when returning from main() in hvmloader. >>> >>> >> I also find that x86_emulate() is never called while emulate_realmode >> is set in the hypervisor. >> >>> I guess it''s possible that if you are using a version of unstable that >>> predates Keir''s recent hvmloader changes, you wouldn''t have hvmloader >>> switching to real mode. That could explain some of the weirdness you''re >>> seeing. What changeset are you on? >>> >> So far I am using: r14560_20070326 >> >> Now I am trying with: r14631_20070329 >> >> Thanks & Regards, >> Nitin >> Open Source Technology Center, Intel Corporation. >> ------------------------------------------------------------------------- >> The mind is like a parachute; it works much better when it''s open. >> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 04:28:59 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 04:28:59 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX7nP-0006v8-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 04:28:59 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, HTML_MESSAGE 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:42187 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HX7n2-0006y0-G6 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 04:28:42 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX7no-0005Nj-IN; Fri, 30 Mar 2007 03:29:24 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX7nS-00055g-V2 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:29:02 +0000 Received: from mga02.intel.com ([134.134.136.20]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX7nQ-0005H9-AK for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:29:00 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 29 Mar 2007 20:27:49 -0700 Received: from orsmsx335.jf.intel.com ([10.22.226.40]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2007 20:27:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,350,1170662400"; d="scan''208,217"; a="218992723:sNHT45283483" Received: from pdsmsx404.ccr.corp.intel.com ([172.16.12.64]) by orsmsx335.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 20:27:49 -0700 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 30 Mar 2007 11:27:46 +0800 Message-ID: <991B62EB36934C4EBD5B605518A724764C421E@pdsmsx404.ccr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: About IO Thread-Index: AcdyeZanoNJ6aPq6SKS+5oY9VtNsoAAAcRKA From: "Liu, Huahang" <huahang.liu@intel.com> To: <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 30 Mar 2007 03:27:49.0477 (UTC) FILETIME=[646D3150:01C7727B] X-SA-Exim-Connect-IP: 134.134.136.20 X-SA-Exim-Mail-From: huahang.liu@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,HTML_90_100, HTML_MESSAGE autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] About IO X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============1655015377==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. --===============1655015377=Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7727B.62F20954" This is a multi-part message in MIME format. ------_=_NextPart_001_01C7727B.62F20954 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable =20 What is the MMIO address space of Xen HVM?=20 What happen when I read from or write to these IO ports?=20 =20 Thanks,=20 Huahang ------_=_NextPart_001_01C7727B.62F20954 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"> <meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)"> <style> <!-- /* Font Definitions */ @font-face {font-family:SimSun; panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:SimSun; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; text-align:justify; font-size:10.5pt; font-family:"Calibri","sans-serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal; font-family:"Calibri","sans-serif"; color:windowtext;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:#1F497D;} .MsoChpDefault {mso-style-type:export-only; font-size:10.0pt;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--> </head> <body lang=3DZH-CN link=3Dblue vlink=3Dpurple style=3D''text-justify-trim:punctuation''> <div class=3DSection1> <p class=3DMsoNormal align=3Dleft style=3D''text-align:left''><span lang=3DEN-US><o:p> </o:p></span></p> <p class=3DMsoNormal><span lang=3DEN-US>What is the MMIO address space of Xen HVM? <o:p></o:p></span></p> <p class=3DMsoNormal><span lang=3DEN-US>What happen when I read from or write to these IO ports? <o:p></o:p></span></p> <p class=3DMsoNormal><span lang=3DEN-US><o:p> </o:p></span></p> <p class=3DMsoNormal><span lang=3DEN-US>Thanks, <o:p></o:p></span></p> <p class=3DMsoNormal><span lang=3DEN-US> Huahang<o:p></o:p></span></p> </div> </body> </html> ------_=_NextPart_001_01C7727B.62F20954-- --===============1655015377=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1655015377==-- From xen-devel-bounces.xensource.com Fri Mar 30 04:38:04 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 04:38:04 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX7wC-0007Bv-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 04:38:04 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:55591 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HX7vz-0008TM-AT (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 04:37:56 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX7wj-0005p8-7A; Fri, 30 Mar 2007 03:38:37 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX7wK-0005Wi-9n for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:38:12 +0000 Received: from mga02.intel.com ([134.134.136.20]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX7wH-0005IB-Js for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:38:10 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 29 Mar 2007 20:36:59 -0700 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2007 20:36:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,350,1170662400"; d="scan''208"; a="218996787:sNHT17229744" Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 20:36:54 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Mar 2007 11:36:51 +0800 Message-ID: <B30DA1341B0CFA4893EF8A36B40B5C5DF226BA@pdsmsx411.ccr.corp.intel.com> In-Reply-To: <991B62EB36934C4EBD5B605518A724764C421E@pdsmsx404.ccr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] About IO Thread-Index: AcdyeZanoNJ6aPq6SKS+5oY9VtNsoAAAcRKAAAAiJ5AFrom: "Li, Xin B" <xin.b.li@intel.com> To: "Liu, Huahang" <huahang.liu@intel.com>, <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 30 Mar 2007 03:36:54.0423 (UTC) FILETIME=[A93D5A70:01C7727C] X-SA-Exim-Connect-IP: 134.134.136.20 X-SA-Exim-Mail-From: xin.b.li@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] About IO X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com>What is the MMIO address space of Xen HVM?=20>From 4G-256M to 4G, you can take a look at the definition ofHVM_BELOW_4G_MMIO_LENGTH.>What happen when I read from or write to these IO ports?=20Depends on the devices located there, if no device, Read returns ~0, while writes are ignored. -Xin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 04:56:45 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 04:56:45 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX8EH-0007VJ-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 04:56:45 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:32990 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HX8E7-00080J-Fo (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 04:56:40 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX8Er-0006Gz-QV; Fri, 30 Mar 2007 03:57:21 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX8EU-0005z0-Al for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:56:58 +0000 Received: from e5.ny.us.ibm.com ([32.97.182.145]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX8ER-0005UD-4e for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 03:56:56 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2U3tcRH009983 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 23:55:38 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2U3tcW5183340 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 23:55:38 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2U3tctD017320 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 23:55:38 -0400 Received: from [9.65.11.17] (sig-9-65-11-17.mts.ibm.com [9.65.11.17]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2U3tTrp017207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Mar 2007 23:55:36 -0400 Message-ID: <460C8A2E.7060906@us.ibm.com> Date: Thu, 29 Mar 2007 22:55:26 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: "Kamble, Nitin A" <nitin.a.kamble@intel.com> References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> <460C8207.8000604@us.ibm.com> In-Reply-To: <460C8207.8000604@us.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.182.145 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Ugh! Sorry that got munged. Let me try again: (XEN) hvmop_emulate_realmode (XEN) guest requests real mode emulation (XEN) foo 221 (XEN) eip = 0xd338d (XEN) eip = 0xd338e (XEN) eip = 0xffbf0000 (XEN) failed to emulate instruction at %eip = 0xd338d (XEN) domain_crash_sync called from vmcs.c:625 (XEN) Domain 1 (vcpu#0) crashed on cpu#0: (XEN) ----[ Xen-3.0-unstable x86_32 debug=n Not tainted ]---- (XEN) CPU: 0 (XEN) EIP: 0010:[<000d338d>] (XEN) EFLAGS: 00000002 CONTEXT: hvm (XEN) eax: 00000076 ebx: 000d7324 ecx: 000d7324 edx: 000000e9 (XEN) esi: 000d4e54 edi: 000d3380 ebp: 000d72a8 esp: 000d72a8 (XEN) cr0: 00050032 cr4: 00000651 cr3: 00000000 cr2: 00000000 (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0018 cs: 0010 Regards, Anthony Liguori Anthony Liguori wrote:> Kamble, Nitin A wrote: >> Hi Anthony, >> With the new revision I am able to get the -emulate-16bit command >> line switch working. >> >> (XEN) HVM2: Creating MP tables >> ... (XEN) HVM2: Loading >> Cirrus VGABIOS ... (XEN) >> HVM2: Loading ACPI >> ... (XEN) HVM2: >> Loading VMXAssist ... deadbeef >> (XEN) HVM2: >> foo >> (XEN) >> hvmop_emulate_realmode >> (XEN) guest requests real mode >> emulation (XEN) foo >> 221 >> (XEN) HVM2: Invoking ROMBIOS >> ... (XEN) hvm.c:446:d2 >> Triple fault on VCPU0 - invoking HVM system reset. > > The Triple fault you''re seeing here is terribly curious. Also the > "deadbeef" output. Just to sanity check, I threw the following printk > in vmcs.c > > while (!hypercall_preempt_check()) { > + printk("eip = 0x%x\n", regs->eip); > if (x86_emulate(&ctxt, &em_ops)) { > > And I get the following output with a FC5 guest: > > (XEN) > hvmop_emulate_realmode > (XEN) guest requests real mode > emulation (XEN) foo > 221 > (XEN) eip = > 0xd338d > (XEN) eip = > 0xd338e > (XEN) eip = > 0xffbf0000 > (XEN) failed to emulate instruction at %eip = > 0xd338d (XEN) domain_crash_sync called from > vmcs.c:625 (XEN) Domain 1 (vcpu#0) > crashed on cpu#0: (XEN) ----[ > Xen-3.0-unstable x86_32 debug=n Not tainted ]---- > (XEN) CPU: > 0 (XEN) > EIP: > 0010:[<000d338d>] (XEN) > EFLAGS: 00000002 CONTEXT: > hvm (XEN) eax: 00000076 > ebx: 000d7324 ecx: 000d7324 edx: 000000e9 (XEN) esi: > 000d4e54 edi: 000d3380 ebp: 000d72a8 esp: 000d72a8 > (XEN) cr0: 00050032 cr4: 00000651 cr3: 00000000 cr2: > 00000000 (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 > ss: 0018 cs: 0010 > So, perhaps it''s the guest you''re using? Clearly, we''re running in > x86_emulate and hitting a 16 bit instruction we can''t handle. N.B. > the printk in the error path for x86_emulate is wrong. I should be > looking at regs->eip, not GUEST_RIP since that wouldn''t have been > updated again. > > Regards, > > Anthony Liguori > >> I have not added any debug lines in the code yet, and I don''t know >> how far is the emulator going. I will check it tomorrow. >> >> Thanks & Regards, >> Nitin >> Open Source Technology Center, Intel Corporation. >> ------------------------------------------------------------------------- >> >> The mind is like a parachute; it works much better when it''s open. >> >> >> On Thu, 2007-03-29 at 17:59 -0700, Nitin A Kamble wrote: >>> On Thu, 2007-03-29 at 19:11 -0500, Anthony Liguori wrote: >>> >>>> Okay, you''ll need to make sure that hvmloader and qemu are both >>>> being rebuilt and reinstalled. >>>> >>>> >>> I am sure both are built with the patch and installed correctly. >>> >>>> The really curious thing is that eip from the VMCS is set to 0. >>>> eip should be address of the EIP of whatever movl cr0 instruction >>>> that occurs when returning from main() in hvmloader. >>>> >>>> >>> I also find that x86_emulate() is never called while >>> emulate_realmode is set in the hypervisor. >>> >>>> I guess it''s possible that if you are using a version of unstable >>>> that predates Keir''s recent hvmloader changes, you wouldn''t have >>>> hvmloader switching to real mode. That could explain some of the >>>> weirdness you''re seeing. What changeset are you on? >>>> >>> So far I am using: r14560_20070326 >>> >>> Now I am trying with: r14631_20070329 >>> >>> Thanks & Regards, >>> Nitin >>> Open Source Technology Center, Intel Corporation. >>> ------------------------------------------------------------------------- >>> >>> The mind is like a parachute; it works much better when it''s open. >>> >> > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 05:14:37 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 05:14:37 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX8VZ-0000jx-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 05:14:37 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:48031 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HX8VK-0002q2-VE (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 05:14:27 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX8W5-0006ik-48; Fri, 30 Mar 2007 04:15:09 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX8Vh-0006QX-J9 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 04:14:45 +0000 Received: from mga02.intel.com ([134.134.136.20]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX8Vd-0005VM-1J for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 04:14:43 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 29 Mar 2007 21:13:30 -0700 Received: from orsmsx334.jf.intel.com ([10.22.226.45]) by orsmga001.jf.intel.com with ESMTP; 29 Mar 2007 21:13:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,350,1170662400"; d="scan''208"; a="219011041:sNHT18419345" Received: from pdsmsx404.ccr.corp.intel.com ([172.16.12.64]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 21:13:30 -0700 Received: from pdsmsx414.ccr.corp.intel.com ([172.16.12.95]) by pdsmsx404.ccr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 30 Mar 2007 12:13:27 +0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Mar 2007 12:13:26 +0800 Message-ID: <FE7BBCFBB500984A9A7922EBC95F516E0456C0@pdsmsx414.ccr.corp.intel.com> In-Reply-To: <B30DA1341B0CFA4893EF8A36B40B5C5DF22629@pdsmsx411.ccr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] [PATCH] Enable VMX MSR bitmap support Thread-Index: AcdyKjZ/7APHhrjjQt+EbbWJ0G+NwgABFZSWAA6tTmAABf35IA=From: "Cui, Dexuan" <dexuan.cui@intel.com> To: "Li, Xin B" <xin.b.li@intel.com>, "Keir Fraser" <keir@xensource.com>, <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 30 Mar 2007 04:13:27.0208 (UTC) FILETIME=[C43DCA80:01C77281] X-SA-Exim-Connect-IP: 134.134.136.20 X-SA-Exim-Mail-From: dexuan.cui@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] [PATCH] Enable VMX MSR bitmap support X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Keir, Please visit http://www.intel.com/products/processor/manuals/index.htm to obtain the latest SDMs. Btw, the errata in the document "Documentation Changes" in the above URL also show this correction.=20 -- Dexuan>-----Original Message----- >From: xen-devel-bounces@lists.xensource.com >[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Li, Xin B >Sent: 2007=C4=EA3=D4=C230=C8=D5 10:18 >To: Keir Fraser; xen-devel@lists.xensource.com >Subject: RE: [Xen-devel] [PATCH] Enable VMX MSR bitmap support > >> Also you got the write-low and read-high offsets into the MSR bitmap >the wrong way round! >> > >Oops, seems you''re using an old version of Intel PRM, if you check the >latest one, you can find the sequence changed, which also confused me at >the beginning!!! >-Xin > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 06:39:35 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 06:39:35 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HX9pn-000374-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 06:39:35 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:38839 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HX9pc-00025N-79 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 06:39:29 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX9qM-0007Jh-Ep; Fri, 30 Mar 2007 05:40:10 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HX9q1-00071o-4d for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 05:39:49 +0000 Received: from mga09.intel.com ([134.134.136.24]) by lists.xensource.com with esmtp (Exim 4.50) id 1HX9py-00061Z-7m for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 05:39:47 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by mga09.intel.com with ESMTP; 29 Mar 2007 22:38:32 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by fmsmga002.fm.intel.com with ESMTP; 29 Mar 2007 22:38:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,350,1170662400"; d="scan''208"; a="66250996:sNHT19056996" Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 22:38:32 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Mar 2007 13:38:24 +0800 Message-ID: <B30DA1341B0CFA4893EF8A36B40B5C5DF2274B@pdsmsx411.ccr.corp.intel.com> In-Reply-To: <B30DA1341B0CFA4893EF8A36B40B5C5DF22629@pdsmsx411.ccr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] [PATCH] Enable VMX MSR bitmap support Thread-Index: AcdyKjZ/7APHhrjjQt+EbbWJ0G+NwgABFZSWAA6tTmAACRBPIA=From: "Li, Xin B" <xin.b.li@intel.com> To: "Li, Xin B" <xin.b.li@intel.com>, "Keir Fraser" <keir@xensource.com>, <xen-devel@lists.xensource.com> X-OriginalArrivalTime: 30 Mar 2007 05:38:32.0422 (UTC) FILETIME=[A72FA060:01C7728D] X-SA-Exim-Connect-IP: 134.134.136.24 X-SA-Exim-Mail-From: xin.b.li@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] [PATCH] Enable VMX MSR bitmap support X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com So this patch is needed to fix the issue according to the latest PRM. -Xin diff -r a5a2c49eda68 xen/arch/x86/hvm/vmx/vmcs.c --- a/xen/arch/x86/hvm/vmx/vmcs.c Tue Mar 13 18:13:11 2007 -0600 +++ b/xen/arch/x86/hvm/vmx/vmcs.c Fri Mar 30 10:30:16 2007 +0800 @@ -70,12 +70,12 @@ static void disable_intercept_for_msr(u3 if ( msr <=3D 0x1fff ) { __clear_bit(msr, hvm_msr_bitmap + 0x000); /* read-low */ - __clear_bit(msr, hvm_msr_bitmap + 0x400); /* write-low */ + __clear_bit(msr, hvm_msr_bitmap + 0x800); /* write-low */ } else if ( (msr >=3D 0xc0000000) && (msr <=3D 0xc0001fff) ) { msr &=3D 0x1fff; - __clear_bit(msr, hvm_msr_bitmap + 0x800); /* read-high */ + __clear_bit(msr, hvm_msr_bitmap + 0x400); /* read-high */ __clear_bit(msr, hvm_msr_bitmap + 0xc00); /* write-high */ } }>-----Original Message----- >From: xen-devel-bounces@lists.xensource.com=20 >[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Li, Xin B >Sent: Friday, March 30, 2007 10:18 AM >To: Keir Fraser; xen-devel@lists.xensource.com >Subject: RE: [Xen-devel] [PATCH] Enable VMX MSR bitmap support > >> Also you got the write-low and read-high offsets into the MSR bitmap >the wrong way round! >> > >Oops, seems you''re using an old version of Intel PRM, if you check the >latest one, you can find the sequence changed, which also=20 >confused me at >the beginning!!! >-Xin > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 07:12:23 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 07:12:23 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXALX-00023N-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 07:12:23 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:57642 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HXAKy-0002om-Vw (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 07:11:53 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXALj-0007mK-D6; Fri, 30 Mar 2007 06:12:35 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXALM-0007UA-ST for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 06:12:12 +0000 Received: from 207.47.60.147.static.nextweb.net ([207.47.60.147] helo=rpc.xensource.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HXALK-0006ED-4R for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 06:12:10 +0000 Received: from cthulhu.local ([86.14.224.248]) by rpc.xensource.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Mar 2007 23:10:58 -0700 From: Ian Campbell <Ian.Campbell@XenSource.com> To: "Subrahmanian, Raj" <raj.subrahmanian@unisys.com> In-Reply-To: <94C8C9E8B25F564F95185BDA64AB05F604E3B2C8@USTR-EXCH5.na.uis.unisys.com> References: <94C8C9E8B25F564F95185BDA64AB05F604E3B2C8@USTR-EXCH5.na.uis.unisys.com> Content-Type: text/plain Date: Fri, 30 Mar 2007 07:11:13 +0100 Message-Id: <1175235073.23829.4.camel@cthulhu.hellion.org.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Mar 2007 06:10:58.0536 (UTC) FILETIME=[2F290E80:01C77292] X-SA-Exim-Connect-IP: 207.47.60.147 X-SA-Exim-Mail-From: Ian.Campbell@xensource.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] Is unmodified_drivers broken? X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com, "Nowatzki, Thomas L" <Thomas.Nowatzki@UNISYS.com> X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Thu, 2007-03-29 at 18:27 -0400, Subrahmanian, Raj wrote:> I discovered that the following directories need to be deleted/renamed. > > /usr/src/linux/include/xen > /usr/src/linux/incude/asm-i386/mach-xen > > And then, run mkbuildtree and do make as in the README file, and I am > good to go.Excellent.> So, here''s my question : Even though I am on a x86_64 hvm, why does it > include and compile code from asm-i386? Renaming (or not renaming the) > asm-x86_64/mach-xen seems to have absolutely no effect.Some of the x86_64 headers do #include <asm-i386/...> since the two platforms share some code. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 08:10:31 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 08:10:31 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXBFn-0004T5-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 08:10:31 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:54790 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXBFb-0003DN-BA (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 08:10:24 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXBGL-0008Iu-PF; Fri, 30 Mar 2007 07:11:05 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXBFx-000810-SU for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 07:10:41 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[joCx6s9odb8whuxZPgm6cBBeJF7ZcAjV]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXBFs-0006c4-Tq for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 07:10:39 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXBEh-00031F-00; Fri, 30 Mar 2007 08:09:23 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 08:10:24 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: "Cui, Dexuan" <dexuan.cui@intel.com>, "Li, Xin B" <xin.b.li@intel.com>, Keir Fraser <keir@xensource.com>, <xen-devel@lists.xensource.com> Message-ID: <C2327670.526C%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] [PATCH] Enable VMX MSR bitmap support Thread-Index: AcdyKjZ/7APHhrjjQt+EbbWJ0G+NwgABFZSWAA6tTmAABf35IAAGUJsU In-Reply-To: <FE7BBCFBB500984A9A7922EBC95F516E0456C0@pdsmsx414.ccr.corp.intel.com> Mime-version: 1.0 Content-type: text/plain; charset="ISO-2022-JP" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] [PATCH] Enable VMX MSR bitmap support X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Perhaps your public manuals aren''t as up to date as you think? The ones I see are dated October/November 2006 and do not mention an errata in that section of the manual. -- Keir On 30/3/07 05:13, "Cui, Dexuan" <dexuan.cui@intel.com> wrote:> Keir, > Please visit http://www.intel.com/products/processor/manuals/index.htm to > obtain the latest SDMs. > Btw, the errata in the document "Documentation Changes" in the above URL also > show this correction. > > -- Dexuan > >> -----Original Message----- >> From: xen-devel-bounces@lists.xensource.com >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Li, Xin B >> Sent: 2007$BG/(B3$B7n(B30$BF|(B 10:18 >> To: Keir Fraser; xen-devel@lists.xensource.com >> Subject: RE: [Xen-devel] [PATCH] Enable VMX MSR bitmap support >> >>> Also you got the write-low and read-high offsets into the MSR bitmap >> the wrong way round! >>> >> >> Oops, seems you''re using an old version of Intel PRM, if you check the >> latest one, you can find the sequence changed, which also confused me at >> the beginning!!! >> -Xin >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 09:04:22 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 09:04:22 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXC5t-0005Kj-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 09:04:21 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:55059 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXC5C-0000R0-Bk (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 09:03:43 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXC5w-0001eg-W0; Fri, 30 Mar 2007 08:04:25 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXC5a-0001Mn-CK for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 08:04:02 +0000 Received: from ug-out-1314.google.com ([66.249.92.169]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXC5X-0006zy-4C for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 08:04:00 +0000 Received: by ug-out-1314.google.com with SMTP id y2so930399uge for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 01:02:51 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:subject:message-id:mime-version:content-type:content-disposition:user-agent:sender; b=YqcZkqn+UgAjzQaTJPmFLqZ3/ielBrbPVEuWIrzumpwfJ9hL+GSIsbF2rLWyyykLVyWtRW0WeeFKKskVqqRF66VghJzM+CM2gY1CJbfOtsz/umvetY1eTMlN+8jv7BVTv7sQ0VWYrCj1SyQbILIsOVCiYliesFGgw+WLzo0y/7UDomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:subject:message-id:mime-version:content-type:content-disposition:user-agent:sender; b=DL5rSrNcsPirtVx8v0WxzHD2bV85gOjjy+rXSYPYfMzCfwvMjGiiECKS1nsW3wMtvbFwrPDPQ9IQQTyi0pzOOM5zdqTPu+VH92CX6l2l/UWe0PPXxihYqKh+9mXH2FIw7Mpxm/FI/Gf+Cl6dtnSHAbo9V9xzAsGmEKNTjJ47+BYReceived: by 10.67.27.15 with SMTP id e15mr1814335ugj.1175241770957; Fri, 30 Mar 2007 01:02:50 -0700 (PDT) Received: from localhost ( [130.225.0.251]) by mx.google.com with ESMTP id z37sm690631ikz.2007.03.30.01.02.47; Fri, 30 Mar 2007 01:02:48 -0700 (PDT) Date: Fri, 30 Mar 2007 10:01:49 +0200 From: Jacob Gorm Hansen <jacobg@diku.dk> To: Xen-devel <xen-devel@lists.xensource.com> Message-ID: <20070330080149.GA3725@jacobpad.daimi.au.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.12-2006-07-14 X-SA-Exim-Connect-IP: 66.249.92.169 X-SA-Exim-Mail-From: jacobgorm@gmail.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Triggering hotplug scripts multiple times X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com hi list, I am not sure how much of a problem this is in real life, but since the changes to support kexec went in, it has been possible for a domU to trigger its hotplug scripts over and over, by repeatedly changing the frontend state of a virtual device. This is only a problem if a hotplug script has a leak, for instance by adding an iptables rule and not deleting it when the vif goes offline, in which case it is probably possible to exhaust the dom0 kernel''s memory by filling it up with iptables entries (iptables does not seem to enforce any upper limit). Another potential issue is that a high CPU load in dom0 can be created by repeated hotplugging of devices. I am not sure what the correct workaround is, other than paying attention to the quality of hotplug scripts. Somehow it feels wrong that a guest domain is able to arbitrarily trigger scripts in dom0, though the ability to restart devices is a necessity for unprivileged boot-loaders. Perhaps the hotplug scripts should only be triggered once, the first time the frontend is configured? regards, Jacob _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 09:05:41 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 09:05:41 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXC7B-0005M3-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 09:05:41 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, HTML_MESSAGE 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:56194 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXC6s-0001JC-Bm (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 09:05:27 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXC7d-00022G-5z; Fri, 30 Mar 2007 08:06:09 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXC7F-0001jq-Ny for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 08:05:45 +0000 Received: from outbound.mse10.exchange.ms ([216.52.164.190]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXC7C-00070V-Ux for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 08:05:43 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 30 Mar 2007 04:01:31 -0400 Message-ID: <9392A06CB0FDC847B3A530B3DC174E7B0240F9EB@mse10be1.mse10.exchange.ms> In-Reply-To: <991B62EB36934C4EBD5B605518A724764C421E@pdsmsx404.ccr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-devel] About IO Thread-Index: AcdyeZanoNJ6aPq6SKS+5oY9VtNsoAAAcRKAAAkKPyAFrom: "Guy Zana" <guy@neocleus.com> To: "Liu, Huahang" <huahang.liu@intel.com>, <xen-devel@lists.xensource.com> X-SA-Exim-Connect-IP: 216.52.164.190 X-SA-Exim-Mail-From: guy@neocleus.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=ham version=3.1.0 Subject: RE: [Xen-devel] About IO X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0293318034==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. --===============0293318034=Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C772A1.B76E83F5" This is a multi-part message in MIME format. ------_=_NextPart_001_01C772A1.B76E83F5 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable When a guest access a pseudo physical memory address, the hypervisor tries to translate it to the equivalent machine address (real memory). If the address does not exist in the guets''s P2M (physical to machine) translation then it is considered to be mmio, in this case, a ioctl_t struct representing that access is being built and sent to the device model of the HVM guest in domain0, there it is handled by the emulated hardware. =20 Non-prefetchable MMIO (buffered) regions are being mapped to the guest''s memory layout and they actually a part of it. Since it is not prefetchable, a buffered mmio region is also mapped to the device model and being accessed "randomly", preformance is better this way. =20 Thanks, Guy. ________________________________ From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Liu, Huahang Sent: Friday, March 30, 2007 6:28 AM To: xen-devel@lists.xensource.com Subject: [Xen-devel] About IO =09 =09 =20 What is the MMIO address space of Xen HVM?=20 What happen when I read from or write to these IO ports?=20 =20 Thanks,=20 Huahang ------_=_NextPart_001_01C772A1.B76E83F5 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:v =3D=20 "urn:schemas-microsoft-com:vml" xmlns:o =3D=20 "urn:schemas-microsoft-com:office:office" xmlns:w =3D=20 "urn:schemas-microsoft-com:office:word" xmlns:m =3D=20 "http://schemas.microsoft.com/office/2004/12/omml"><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.6000.16414" name=3DGENERATOR> <STYLE>@font-face { font-family: SimSun; } @font-face { font-family: Cambria Math; } @font-face { font-family: Calibri; } @font-face { font-family: SimSun; } @page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; } P.MsoNormal { FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; TEXT-ALIGN: justify } LI.MsoNormal { FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; TEXT-ALIGN: justify } DIV.MsoNormal { FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; TEXT-ALIGN: justify } A:link { COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99 } SPAN.MsoHyperlink { COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99 } A:visited { COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99 } SPAN.MsoHyperlinkFollowed { COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99 } SPAN.EmailStyle17 { COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal } SPAN.EmailStyle18 { COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply } .MsoChpDefault { FONT-SIZE: 10pt; mso-style-type: export-only } DIV.Section1 { page: Section1 } </STYLE> <!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></HEAD> <BODY lang=3DZH-CN style=3D"TEXT-JUSTIFY-TRIM: punctuation" vLink=3Dpurple link=3Dblue> <DIV dir=3Dltr align=3Dleft><SPAN class=3D296244607-30032007><FONT face=3DArial=20 color=3D#0000ff size=3D2>When a guest access a pseudo physical memory address,=20 the hypervisor tries to translate it to the equivalent machine address (real=20 memory). If the address does not exist in the guets''s P2M (physical to=20 machine) translation then it is considered to be mmio, in this=20 case, a ioctl_t struct representing that access is being built and sent to the=20 device model of the HVM guest in domain0, there it is handled by the emulated=20 hardware.</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D296244607-30032007><FONT face=3DArial=20 color=3D#0000ff size=3D2></FONT></SPAN> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D296244607-30032007><FONT face=3DArial=20 color=3D#0000ff size=3D2>Non-prefetchable MMIO (buffered) regions are being mapped=20 to the guest''s memory layout and they actually a part of=20 it.</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D296244607-30032007><FONT face=3DArial=20 color=3D#0000ff size=3D2>Since it is not prefetchable, a buffered mmio region=20 is also mapped to the device model and being accessed "randomly", preformance is=20 better this way.</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D296244607-30032007><FONT face=3DArial=20 color=3D#0000ff size=3D2></FONT></SPAN> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D296244607-30032007><FONT face=3DArial=20 color=3D#0000ff size=3D2>Thanks,</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D296244607-30032007><FONT face=3DArial=20 color=3D#0000ff size=3D2>Guy.</FONT></SPAN></DIV><BR> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"> <DIV class=3DOutlookMessageHeader lang=3Dhe dir=3Dltr align=3Dleft> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> xen-devel-bounces@lists.xensource.com=20 [mailto:xen-devel-bounces@lists.xensource.com] <B>On Behalf Of </B>Liu,=20 Huahang<BR><B>Sent:</B> Friday, March 30, 2007 6:28 AM<BR><B>To:</B>=20 xen-devel@lists.xensource.com<BR><B>Subject:</B> [Xen-devel] About=20 IO<BR></FONT><BR></DIV> <DIV></DIV> <DIV class=3DSection1> <P class=3DMsoNormal style=3D"TEXT-ALIGN: left" align=3Dleft><SPAN=20 lang=3DEN-US><o:p> </o:p></SPAN></P> <P class=3DMsoNormal><SPAN lang=3DEN-US>What is the MMIO address space of Xen HVM?=20 <o:p></o:p></SPAN></P> <P class=3DMsoNormal><SPAN lang=3DEN-US>What happen when I read from or write to=20 these IO ports? <o:p></o:p></SPAN></P> <P class=3DMsoNormal><SPAN lang=3DEN-US><o:p> </o:p></SPAN></P> <P class=3DMsoNormal><SPAN lang=3DEN-US>Thanks, <o:p></o:p></SPAN></P> <P class=3DMsoNormal><SPAN=20 lang=3DEN-US> =20 Huahang<o:p></o:p></SPAN></P></DIV></BLOCKQUOTE></BODY></HTML> ------_=_NextPart_001_01C772A1.B76E83F5-- --===============0293318034=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0293318034==-- From xen-devel-bounces.xensource.com Fri Mar 30 09:10:11 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 09:10:11 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXCBX-0005Oz-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 09:10:11 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:33699 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HXC9z-0007XT-Vr (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 09:08:40 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXCAk-0003CR-4w; Fri, 30 Mar 2007 08:09:22 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXCAL-0002tt-6Y for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 08:08:57 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[l7AwnsiyE3zuQA7yTjkga0kK9d+fnK+U]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXCAI-00072n-JA for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 08:08:55 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXC9B-0003w0-00; Fri, 30 Mar 2007 09:07:45 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 09:08:46 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Jacob Gorm Hansen <jacobg@diku.dk>, Xen-devel <xen-devel@lists.xensource.com> Message-ID: <C232841E.5274%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] Triggering hotplug scripts multiple times Thread-Index: AcdyoqOy4iiINN6VEduBHgAWy6hiGQ=In-Reply-To: <20070330080149.GA3725@jacobpad.daimi.au.dk> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Triggering hotplug scripts multiple times X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 09:01, "Jacob Gorm Hansen" <jacobg@diku.dk> wrote:> I am not sure what the correct workaround is, other than paying > attention to the quality of hotplug scripts. Somehow it feels wrong > that a guest domain is able to arbitrarily trigger scripts in dom0, > though the ability to restart devices is a necessity for unprivileged > boot-loaders. Perhaps the hotplug scripts should only be triggered > once, the first time the frontend is configured?I thought the scripts only triggered when the backend device was first created. I don''t think they should need to execute on frontend state transitions. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 10:27:12 2007 Return-path: <jacobgorm@gmail.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 10:27:12 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXDO4-0006ya-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 10:27:12 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from ug-out-1314.google.com ([66.249.92.168]:62022) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXDNl-0000rd-CF (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <jacobgorm@gmail.com>); Fri, 30 Mar 2007 10:26:53 +0100 Received: by ug-out-1314.google.com with SMTP id k3so704033ugf for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 02:26:53 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:sender; b=jjMSZUl5Rk5j5Z2cYOywvuzEL4aCpLlIZthN//mmej/PTfft62GkGHeX/LnLxj//B2jkQ1gE27iBhnBXG5s9s8xuVCUoVxsG0Hl7yC0woJc36cQ1l1oJAF6MH2kX4ZgV09uqdOUi8rzvVe0A/MydF51T9uSzoEEdICJN4TcWseUDomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:sender; b=pMf19FBfSb4KvQbZKR2VQLoiEo3et/utvZ3TTIWKdUIPKKwMFm35vlM3IwYvgmoR2kJef1PnQsqtDcn7r9JWsL+q5fE6bu0hxOUOCc1v/Q5XjGhEFso+8Tti4q5FAron94GZSnvvVk6qMQ2StsclEfGMuY3msJX2Qx9lrGcPpQ0Received: by 10.82.148.7 with SMTP id v7mr3434060bud.1175246812480; Fri, 30 Mar 2007 02:26:52 -0700 (PDT) Received: from localhost ( [130.225.0.251]) by mx.google.com with ESMTP id z40sm832255ikz.2007.03.30.02.26.48; Fri, 30 Mar 2007 02:26:49 -0700 (PDT) Date: Fri, 30 Mar 2007 11:25:50 +0200 From: Jacob Gorm Hansen <jacobg@diku.dk> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: Jacob Gorm Hansen <jacobg@diku.dk>, Xen-devel <xen-devel@lists.xensource.com> Subject: Re: [Xen-devel] Triggering hotplug scripts multiple times Message-ID: <20070330092550.GA4617@jacobpad.daimi.au.dk> References: <20070330080149.GA3725@jacobpad.daimi.au.dk> <C232841E.5274%Keir.Fraser@cl.cam.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <C232841E.5274%Keir.Fraser@cl.cam.ac.uk> User-Agent: Mutt/1.5.12-2006-07-14 Sender: Jacob Gorm Hansen <jacobgorm@gmail.com> On Fri, Mar 30, 2007 at 09:08:46AM +0100, Keir Fraser wrote:> > > > On 30/3/07 09:01, "Jacob Gorm Hansen" <jacobg@diku.dk> wrote: > > > I am not sure what the correct workaround is, other than paying > > attention to the quality of hotplug scripts. Somehow it feels wrong > > that a guest domain is able to arbitrarily trigger scripts in dom0, > > though the ability to restart devices is a necessity for unprivileged > > boot-loaders. Perhaps the hotplug scripts should only be triggered > > once, the first time the frontend is configured? > > I thought the scripts only triggered when the backend device was first > created. I don''t think they should need to execute on frontend state > transitions.Problem is that if the domain disconnects from the netif, which it has to when handing over the device to the domU kernel from a bootloader, the netif is destroyed, and when the new one is created the hotplug script gets kicked, e.g.: case XenbusStateInitialising: if (dev->state == XenbusStateClosed) { printk("%s: %s: prepare for reconnect\n", __FUNCTION__, dev->nodename); if (be->netif) { netif_disconnect(be->netif); be->netif = NULL; } xenbus_switch_state(dev, XenbusStateInitWait); } I suppose one could postpone freeing the netif until the domain has gone away. Another problem with how this currently works is that vifs don''t get garbage collected properly if the domain is killed without a proper shutdown. Jacob From xen-devel-bounces.xensource.com Fri Mar 30 11:13:58 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 11:13:58 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXE7K-0006Uo-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 11:13:58 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:38712 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HXE6o-0008P2-VK (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 11:13:31 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXE7W-0003Tt-PN; Fri, 30 Mar 2007 10:14:10 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXE7A-0003BL-VP for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 10:13:48 +0000 Received: from ug-out-1314.google.com ([66.249.92.174]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXE77-0007wZ-Nd for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 10:13:46 +0000 Received: by ug-out-1314.google.com with SMTP id y2so962236uge for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 03:12:35 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; b=fbMAhFvndk59WsfKjkPA/aUoY9hOnZEvv/THNjNEPLL3ByYx8gcUC17P1OSCZAeNTOjmDeHzFYZx0j+sf8c9Afp1EXJhmXxo39LbeBVJa/OHXKBcVNWNde9zr2nagORkhj/O0xoCRgJK+rwXGVsl+zYjTDBIgrmfTeVqAi2Rt34DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; b=Iz8oEpqSIsrg81HpEkljUXGI9CnC8uQY8G9wlyh0ZZT/qC7mHbO0W/zN4BSr1p2oJIe9IvGHj7rlIYzJR+xsrbd5cAKAcXaYHRlKavnbdFyZdXRvfFwrZuIKYaqAaTfELXpB89XuNVwzmYIzYHT83tWU9ebgnjzd7pb5/D60T1wReceived: by 10.82.178.11 with SMTP id a11mr3518276buf.1175249555256; Fri, 30 Mar 2007 03:12:35 -0700 (PDT) Received: from ?192.168.2.130? ( [83.153.23.216]) by mx.google.com with ESMTP id b33sm915451ika.2007.03.30.03.12.33; Fri, 30 Mar 2007 03:12:34 -0700 (PDT) In-Reply-To: <B05D2E415E8CC94897BB44233D14EE68057B55CA@USTR-EXCH5.na.uis.unisys.com> References: <B05D2E415E8CC94897BB44233D14EE68057B54C1@USTR-EXCH5.na.uis.unisys.com> <ac269497563576fac1573da5b4bd1800@gmail.com> <B05D2E415E8CC94897BB44233D14EE68057B55CA@USTR-EXCH5.na.uis.unisys.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <dd2bdd64dbc1367e610eac2bd6089847@gmail.com> Content-Transfer-Encoding: quoted-printable From: Emmanuel Ackaouy <ackaouy@gmail.com> Date: Fri, 30 Mar 2007 12:12:29 +0200 To: "Carb, Brian A" <Brian.Carb@unisys.com> X-Mailer: Apple Mail (2.624) X-SA-Exim-Connect-IP: 66.249.92.174 X-SA-Exim-Mail-From: ackaouy@gmail.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Odd CPU Scheduling Behavior X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Mar 29, 2007, at 17:57, Carb, Brian A wrote:> Emmanuel, > > Yes - both vcpus are progressing, but the load gets pushed to one cpu.=20 > If I run top in interactive mode in each vm while the test is running,=20 > and monitor cpu usage (set delay to 1 and show separate cpu states),=20 > each of the vm''s cpus are getting equally loaded on average.If I get this straight, you are running 2 VMs each with 2 CPU intensive=20 VCPUs and you''re running all of this load on 2 physical CPUs. So we expect=20 there should be some time slicing. Let''s call the VCPUs: Vx.y where x is the VMid and y is the VCPUid. Since there is no gang scheduling, it''s just as likely that V0.0 and=20 V0.1 will time slice on the same physical CPU than it is for say V0.0 and V1.0. You could try to force V0.0 and V0.1 on different physical CPUs but=20 there would still be no guarantee that they run at the same time (in a gang). This is not really an oddity. What behavior would you like to see?> There are a few more oddities: > > First, I see this behavior almost all the time when I run the test.=20 > However, occasionally, I do not see this behavior at all, and the load=20 > stays spread out on both cpus for the duration of the test (2=20 > minutes). > > Second, if I boot my ES7000/one to use only 4 CPUs (2 dual-core=20 > sockets), the load always stays evenly distributed on both cpus.You said you were using cpumasks to force all of your VCPUs on 2 given physical CPUs anyway so I''m not sure I understand the difference between booting up with 4 sockets or 2... Once VCPUs are running somewhere, they tend to stay there so if you were to start your test on VM0 first, it would spread it''s VCPUs across two=20 physical CPUs. Then, when you start VM1, one VCPU migration would happen that would cause each physical CPU to host two VCPUs. It should be about a 50-50 chance for you to land V0.0 and V0.1 on the same physical CPU. Now you''re running some I/O load on the VMs so one must also wonder if the VCPUs don''t occasionally sleep, causing potential migrations to run=20 any queued VCPU off the neighbor CPU. The physical CPUs are at 100% and the VCPUs don''t move around at all during your tests?> > brian carb > unisys corporation - malvern, pa > > -----Original Message----- > From: Emmanuel Ackaouy [mailto:ackaouy@gmail.com] > Sent: Thursday, March 29, 2007 11:42 AM > To: Carb, Brian A > Cc: xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] Odd CPU Scheduling Behavior > > There is no gang scheduling in Xen so what you see is not unexpected. > Both VCPUs of the same VM are as likely to run on the same physical=20 > CPU than not. For each VM though, both its VCPUs should get equal CPU=20 > time if they are runnable even if they alternatively run on the same=20 > physical CPU. > > I have seen some multithreaded applications/libraries back off using=20 > execution vehicles (processes) to schedule a runnable thread when it=20 > doesn''t seem to make forward progress, probably because some code=20 > somewhere assumes another process is hogging the CPU and it''s=20 > therefore better to lower the number of execution vehicles. In this=20 > case, multithreaded apps running on a 2CPU guest on Xen sometimes only=20 > schedule work on 1CPU when there is another VM competing for the=20 > physical CPU resources. > > Are both VCPUs of each VM making forward progress during your test? > > On Mar 29, 2007, at 16:58, Carb, Brian A wrote: > >> We''re seeing a cpu scheduling behavior in Xen and we''re wondering if >> anyone can explain it. >> =A0 >> We''re running XEN 3.0.4 on a Unisys ES7000/one with 8 CPUs (4 >> dual-core sockets) and 32GB memory. XEN is built on SLES10, and the >> system is booted with dom0_mem=3D512mb. We have 2 para-virtual machines, >> each booted with 2 vcpus and 2GB memory, and each running SLES10 and >> Apache2 with worker multi-processing modules. >> =A0 >> The vcpus of dom0, vm1 and vm2 are pinned as follows: >> =A0 >> dom0 is relegated to 2 vcpus (xm vcpu-set 0 2) and these are pinned to >> cpus 0-1 >> vm1 uses 2 vcpus pinned to cpus 2-3 >> vm2 uses 2 vcpus pinned to cpus 2-3 >> =A0 >> The cpus 4 through 7 are left unused. >> =A0 >> Our test runs http_load against the Apache2 web servers in the 2 vms. >> Since Apache2 is using worker multi-processing modules, we expect that >> each vm will spread its load over the 2 vcpus, and during the test we >> have verified this using top and sar inside a vm console. >> =A0 >> The odd behavior occurs when we monitor cpu usage using xenmon in >> interactive mode. By pressing "c", we can observe the load on each of >> the cpus. When we examine cpus 2 and 3 initially, each is used equally >> by vm1 and vm2. However, shortly after we start our testing, cpu2 runs >> vm1 exclusively 100% of the time, and cpu3 runs vm2 100% of the time. >> When the test completes, CPUs 2 and 3 go back to sharing the load of >> vm1 and vm2. >> =A0 >> Is this the expected behavior? >> >> brian carb >> unisys corporation - malvern, >> pa_______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 15:26:18 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 15:26:18 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXI3V-0003qb-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 15:26:17 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:56441 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXI2S-0001OB-BG (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 15:25:18 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXI3D-0001Kx-U4; Fri, 30 Mar 2007 14:25:59 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXI2s-00012z-2L for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 14:25:38 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[49wEFXSkvWVFqD5wi7MzrEyNOyfqTmyg]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXI2n-0002CY-K8 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 14:25:36 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXI1c-0003oe-00; Fri, 30 Mar 2007 15:24:20 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 15:25:21 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Jacob Gorm Hansen <jacobg@diku.dk> Message-ID: <C232DC61.52AC%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] Triggering hotplug scripts multiple times Thread-Index: Acdy1z9dfixzTd7KEdusYQAWy6hiGQ=In-Reply-To: <20070330092550.GA4617@jacobpad.daimi.au.dk> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Triggering hotplug scripts multiple times X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Xen-devel <xen-devel@lists.xensource.com> X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 10:25, "Jacob Gorm Hansen" <jacobg@diku.dk> wrote:> Problem is that if the domain disconnects from the netif, which it has > to when handing over the device to the domU kernel from a bootloader, > the netif is destroyed, and when the new one is created the hotplug > script gets kicked, e.g.: > > I suppose one could postpone freeing the netif until the domain has gone > away. > > Another problem with how this currently works is that vifs don''t get > garbage collected properly if the domain is killed without a proper > shutdown.I would classify these behaviours as bugs. :-) We shouldn;t be device unregistering until the online status is set to 0 or the directory in xenstore is removed entirely. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 15:34:45 2007 Return-path: <jacobgorm@gmail.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 15:34:45 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXIBh-0004px-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 15:34:45 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from ug-out-1314.google.com ([66.249.92.170]:51716) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HXIA7-0007VF-OZ (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <jacobgorm@gmail.com>); Fri, 30 Mar 2007 15:33:07 +0100 Received: by ug-out-1314.google.com with SMTP id k3so777561ugf for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 07:33:01 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:sender; b=D4P0xqFE9oFTM58zINX7uG6WKlrNsEgvm4s8FfNr6g/J6mtHR/sIck94FLnuCswnEX/RrVnltJY7J2h0hhGiFKBjt3617bP8+g98KnlWG/VkpQ/IOd1FwiQ3Pyj+/3il+Z+oqK0lE+tyc6q3d37ONp97AnPkrXNatQvw5097DCgDomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:sender; b=HvKyTKa6nlbu7j/OnugTfMhp6CRTQ6rdu+vvu3/HzfroelKu0gPbQBu80KIYnf4AMOnqwxEWo70xpip1tGxqqNDmYdK2AuTz6KGcnZnFvLHeThk9399ZCMYAC+XTlQmd5W45QFN/ptcCkMU+p4RsVN9e7qKMf/Mp+ZMB4e4hwx8Received: by 10.82.116.15 with SMTP id o15mr4010443buc.1175265181776; Fri, 30 Mar 2007 07:33:01 -0700 (PDT) Received: from localhost ( [130.225.0.251]) by mx.google.com with ESMTP id z40sm1513972ikz.2007.03.30.07.32.59; Fri, 30 Mar 2007 07:32:59 -0700 (PDT) Date: Fri, 30 Mar 2007 16:32:01 +0200 From: Jacob Gorm Hansen <jacobg@diku.dk> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: Jacob Gorm Hansen <jacobg@diku.dk>, Xen-devel <xen-devel@lists.xensource.com> Subject: Re: [Xen-devel] Triggering hotplug scripts multiple times Message-ID: <20070330143201.GA7727@jacobpad.daimi.au.dk> References: <20070330092550.GA4617@jacobpad.daimi.au.dk> <C232DC61.52AC%Keir.Fraser@cl.cam.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <C232DC61.52AC%Keir.Fraser@cl.cam.ac.uk> User-Agent: Mutt/1.5.12-2006-07-14 Sender: Jacob Gorm Hansen <jacobgorm@gmail.com> On Fri, Mar 30, 2007 at 03:25:21PM +0100, Keir Fraser wrote:> On 30/3/07 10:25, "Jacob Gorm Hansen" <jacobg@diku.dk> wrote: > > > Another problem with how this currently works is that vifs don''t get > > garbage collected properly if the domain is killed without a proper > > shutdown. > > I would classify these behaviours as bugs. :-) We shouldn;t be device > unregistering until the online status is set to 0 or the directory in > xenstore is removed entirely.I agree, I had a look at the netback xenbus code and tried various workarounds, but did not come up with anything that works better than the current stuff. There are some thorny issues with regards to unmapping/remapping the rx/tx rings and so on that must be dealt with correctly, if this is to work. For now, I will create a bug in bugzilla, and have a go at fixing it later, unless someone beats me to it. Regards, Jacob From xen-devel-bounces.xensource.com Fri Mar 30 15:39:43 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 15:39:43 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXIGV-0004uc-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 15:39:43 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:52228 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXIGE-0000rI-6q (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 15:39:31 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXIGx-00028L-Cg; Fri, 30 Mar 2007 14:40:11 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXIGa-0001q6-Dd for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 14:39:48 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[uBWoZTpN+JLXhVOJA9TSMkxBhiyug6CO]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXIGW-0002GT-R2 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 14:39:46 +0000 Received: from c001.vpn.cl.cam.ac.uk ([128.232.105.1]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXIFQ-00046A-00; Fri, 30 Mar 2007 15:38:36 +0100 User-Agent: Microsoft-Entourage/11.2.5.060620 Date: Fri, 30 Mar 2007 15:38:24 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Jacob Gorm Hansen <jacobg@diku.dk> Message-ID: <C232DF70.C923%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] Triggering hotplug scripts multiple times Thread-Index: Acdy2RISUJbfnN7MEduxEgAX8io7RQ=In-Reply-To: <20070330143201.GA7727@jacobpad.daimi.au.dk> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Triggering hotplug scripts multiple times X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Xen-devel <xen-devel@lists.xensource.com> X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 15:32, "Jacob Gorm Hansen" <jacobg@diku.dk> wrote:>> I would classify these behaviours as bugs. :-) We shouldn;t be device >> unregistering until the online status is set to 0 or the directory in >> xenstore is removed entirely. > > I agree, I had a look at the netback xenbus code and tried various > workarounds, but did not come up with anything that works better than > the current stuff. There are some thorny issues with regards to > unmapping/remapping the rx/tx rings and so on that must be dealt with > correctly, if this is to work. > > For now, I will create a bug in bugzilla, and have a go at fixing it > later, unless someone beats me to it.Thanks! K. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 16:14:34 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 16:14:34 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXIoE-0005U5-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 16:14:34 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:52948 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HXImt-0006Od-Nk (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 16:13:16 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXIne-0006fu-U9; Fri, 30 Mar 2007 15:13:58 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXInG-0006Nh-Qo for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 15:13:34 +0000 Received: from outbound-dub.frontbridge.com ([213.199.154.16] helo=outbound2-dub-R.bigfish.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HXInC-0002jp-Q6 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 15:13:32 +0000 Received: from outbound2-dub.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound2-dub-R.bigfish.com (Postfix) with ESMTP id 86C90648B7A; Fri, 30 Mar 2007 15:12:20 +0000 (UTC) Received: from mail103-dub-R.bigfish.com (unknown [10.5.252.3]) by outbound2-dub.bigfish.com (Postfix) with ESMTP id 6EC031930069; Fri, 30 Mar 2007 15:12:20 +0000 (UTC) Received: from mail103-dub (localhost.localdomain [127.0.0.1]) by mail103-dub-R.bigfish.com (Postfix) with ESMTP id 0EDE09C8258; Fri, 30 Mar 2007 15:12:19 +0000 (UTC) X-BigFish: VP Received: by mail103-dub (MessageSwitch) id 1175267538369576_18895; Fri, 30 Mar 2007 15:12:18 +0000 (UCT) Received: from ausb3extmailp02.amd.com (rebel3.amd.com [163.181.251.22]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail103-dub.bigfish.com (Postfix) with ESMTP id 161091508081; Fri, 30 Mar 2007 15:12:14 +0000 (UTC) Received: from SAUSGW01.amd.com (sausgw01.amd.com [163.181.250.21]) by ausb3extmailp02.amd.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2UFBvxQ011671; Fri, 30 Mar 2007 10:12:13 -0500 Received: from 163.181.22.101 by SAUSGW02.amd.com with ESMTP (AMD SMTP Relay (Email Firewall v6.1.0)); Fri, 30 Mar 2007 10:12:06 -0500 X-Server-Uuid: 5FC0E2DF-CD44-48CD-883A-0ED95B391E89 Received: from sausexmb1.amd.com ([163.181.3.156]) by sausexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Fri, 30 Mar 2007 10:12:05 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 30 Mar 2007 10:12:04 -0500 Message-ID: <683860AD674C7348A0BF0DE3918482F604AF0EDD@SAUSEXMB1.amd.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH][SVM] fix #BP intercept (INT3) Thread-Index: Acdy3caWsaVOB1g4RF2MXaudWX+SSA=From: "Woller, Thomas" <thomas.woller@amd.com> To: xen-devel@lists.xensource.com X-OriginalArrivalTime: 30 Mar 2007 15:12:05.0683 (UTC) FILETIME=[C7168830:01C772DD] X-WSS-ID: 6A13F74C3282714151-01-01 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C772DD.C6E4D2DD" X-SA-Exim-Connect-IP: 213.199.154.16 X-SA-Exim-Mail-From: thomas.woller@amd.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] [PATCH][SVM] fix #BP intercept (INT3) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This is a multi-part message in MIME format. ------_=_NextPart_001_01C772DD.C6E4D2DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable This AMD-V patch resolves two severe issues with functionality concerning: 1) INT3 intercept/reflection #BP causing injection/VMEXIT flooding 2) Vista/Longhorn "windowing" failures (Control panel icons, and games fail to be displayed) This patch increments the RIP properly for #BP intercepts (INT3 instructions in the guest) for AMD-V platforms. Both of these issues only manifest if #BP exception intercept is enabled (in support.h) - Without this patch guest code which execute INT3 instructions (0xCC), and relies on the CS:RIP for the next instruction, fail. Under these circumstances this can result in excessive #BP VMEXITs, and resulting excessive reflection of INT3 exception back to the guest, causing severe performance and functional degredation. - The Vista control panel currently fails to properly load the Icons, or fails to be displayed at all. Additionally, some of the Vista games fail to load. Not sure exactly what Vista is doing here with INT3, but vista needs this fix. AMD-V documentation indicates the CS:RIP on the return from #BP VMEXIT points to the 0xCC instruction, *not* the instruction following.=20 Changeset 14628 can be reverted, as both problems do not manifest themselves if #BP is not intercepted. Default #BP exception is useful though for _DOMF_debugging enablement. and no reason to penalize VT on account of an AMD-V bug either :). SW INT 3 (0xcd 0x03) causes a different VMEXIT code (0x75) so this instruction pair for "INT 3" does not need to be added to the svm emulation code (emulate.c). Please apply to Xen-unstable. Applies cleanly to c/s 14631. Signed-off-by Tom Woller <thomas.woller@amd.com> Signed-off-by Thomas Friebel <thomas.friebel@amd.com> --Tom thomas.woller@amd.com +1-512-602-0059 AMD Corporation - Operating Systems Research Center 5204 E. Ben White Blvd. UBC1 Austin, Texas 78741 ------_=_NextPart_001_01C772DD.C6E4D2DD Content-Type: application/octet-stream; name=svm_bp_incr_rip.patch Content-Transfer-Encoding: base64 Content-Description: svm_bp_incr_rip.patch Content-Disposition: attachment; filename=svm_bp_incr_rip.patch ZGlmZiAtciBmZmI5ZGRhNDI5NDYgeGVuL2FyY2gveDg2L2h2bS9zdm0vZW11bGF0ZS5jCi0tLSBh L3hlbi9hcmNoL3g4Ni9odm0vc3ZtL2VtdWxhdGUuYwlXZWQgTWFyIDI4IDE2OjUyOjA1IDIwMDcg KzAxMDAKKysrIGIveGVuL2FyY2gveDg2L2h2bS9zdm0vZW11bGF0ZS5jCUZyaSBNYXIgMzAgMDk6 NDE6MTggMjAwNyAtMDYwMApAQCAtMzczLDYgKzM3Myw3IEBAIE1BS0VfSU5TVFIoQ0xUUywgICAy LCAweDBmLCAweDA2KTsKIE1BS0VfSU5TVFIoQ0xUUywgICAyLCAweDBmLCAweDA2KTsKIE1BS0Vf SU5TVFIoTE1TVywgICAzLCAweDBmLCAweDAxLCAweDAwKTsKIE1BS0VfSU5TVFIoU01TVywgICAz LCAweDBmLCAweDAxLCAweDAwKTsKK01BS0VfSU5TVFIoSU5UMywgICAxLCAweGNjKTsKIAogc3Rh dGljIGNvbnN0IHU4ICpvcGNfYnl0ZXNbSU5TVFJfTUFYX0NPVU5UXSA9IAogewpAQCAtNDA1LDcg KzQwNiw4IEBAIHN0YXRpYyBjb25zdCB1OCAqb3BjX2J5dGVzW0lOU1RSX01BWF9DT1UKICAgICBb SU5TVFJfQ0xUU10gICA9IE9QQ09ERV9DTFRTLAogICAgIFtJTlNUUl9ITFRdICAgID0gT1BDT0RF X0hMVCwKICAgICBbSU5TVFJfTE1TV10gICA9IE9QQ09ERV9MTVNXLAotICAgIFtJTlNUUl9TTVNX XSAgID0gT1BDT0RFX1NNU1cKKyAgICBbSU5TVFJfU01TV10gICA9IE9QQ09ERV9TTVNXLAorICAg IFtJTlNUUl9JTlQzXSAgID0gT1BDT0RFX0lOVDMKIH07CiAKIC8qIApkaWZmIC1yIGZmYjlkZGE0 Mjk0NiB4ZW4vYXJjaC94ODYvaHZtL3N2bS9zdm0uYwotLS0gYS94ZW4vYXJjaC94ODYvaHZtL3N2 bS9zdm0uYwlXZWQgTWFyIDI4IDE2OjUyOjA1IDIwMDcgKzAxMDAKKysrIGIveGVuL2FyY2gveDg2 L2h2bS9zdm0vc3ZtLmMJRnJpIE1hciAzMCAwOTo0OTo1OSAyMDA3IC0wNjAwCkBAIC0yODQzLDYg KzI4NDMsNyBAQCBhc21saW5rYWdlIHZvaWQgc3ZtX3ZtZXhpdF9oYW5kbGVyKHN0cnVjCiAgICAg dW5zaWduZWQgbG9uZyBlaXA7CiAgICAgc3RydWN0IHZjcHUgKnYgPSBjdXJyZW50OwogICAgIGlu dCBkb19kZWJ1ZyA9IDA7CisgICAgaW50IGluc3RfbGVuOwogICAgIHN0cnVjdCB2bWNiX3N0cnVj dCAqdm1jYiA9IHYtPmFyY2guaHZtX3N2bS52bWNiOwogCiAgICAgQVNTRVJUKHZtY2IpOwpAQCAt MzAxNCw3ICszMDE1LDExIEBAIGFzbWxpbmthZ2Ugdm9pZCBzdm1fdm1leGl0X2hhbmRsZXIoc3Ry dWMKICAgICAgICAgaWYgKCB0ZXN0X2JpdChfRE9NRl9kZWJ1Z2dpbmcsICZ2LT5kb21haW4tPmRv bWFpbl9mbGFncykgKQogICAgICAgICAgICAgZG9tYWluX3BhdXNlX2Zvcl9kZWJ1Z2dlcigpOwog ICAgICAgICBlbHNlIAorICAgICAgICB7CisgICAgICAgICAgICBpbnN0X2xlbiA9IF9fZ2V0X2lu c3RydWN0aW9uX2xlbmd0aCh2LCBJTlNUUl9JTlQzLCBOVUxMKTsKKyAgICAgICAgICAgIF9fdXBk YXRlX2d1ZXN0X2VpcCh2bWNiLCBpbnN0X2xlbik7CiAgICAgICAgICAgICBzdm1faW5qZWN0X2V4 Y2VwdGlvbih2LCBUUkFQX2ludDMsIDAsIDApOworICAgICAgICB9CiAjZW5kaWYKICAgICAgICAg YnJlYWs7CiAKZGlmZiAtciBmZmI5ZGRhNDI5NDYgeGVuL2luY2x1ZGUvYXNtLXg4Ni9odm0vc3Zt L2VtdWxhdGUuaAotLS0gYS94ZW4vaW5jbHVkZS9hc20teDg2L2h2bS9zdm0vZW11bGF0ZS5oCVdl ZCBNYXIgMjggMTY6NTI6MDUgMjAwNyArMDEwMAorKysgYi94ZW4vaW5jbHVkZS9hc20teDg2L2h2 bS9zdm0vZW11bGF0ZS5oCUZyaSBNYXIgMzAgMDk6NDY6NTMgMjAwNyAtMDYwMApAQCAtNzIsNiAr NzIsNyBAQCBlbnVtIGluc3RydWN0aW9uX2luZGV4IHsKICAgICBJTlNUUl9DTFRTLAogICAgIElO U1RSX0xNU1csCiAgICAgSU5TVFJfU01TVywKKyAgICBJTlNUUl9JTlQzLAogICAgIElOU1RSX01B WF9DT1VOVCAvKiBNdXN0IGJlIGxhc3QgLSBOdW1iZXIgb2YgaW5zdHJ1Y3Rpb25zIHN1cHBvcnRl ZCAqLwogfTsKIAo ------_=_NextPart_001_01C772DD.C6E4D2DD Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------_=_NextPart_001_01C772DD.C6E4D2DD-- From xen-devel-bounces.xensource.com Fri Mar 30 17:24:42 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 17:24:42 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXJu6-0006RL-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 17:24:42 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:45049 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HXJt4-0007CQ-WF (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 17:23:44 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXJtl-0001mx-NW; Fri, 30 Mar 2007 16:24:21 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXJtP-0001VA-L4; Fri, 30 Mar 2007 16:23:59 +0000 Received: from outbound-fra.frontbridge.com ([62.209.45.174] helo=outbound3-fra-R.bigfish.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HXJtM-0003oN-Kk; Fri, 30 Mar 2007 16:23:57 +0000 Received: from outbound3-fra.bigfish.com (localhost.localdomain [127.0.0.1]) by outbound3-fra-R.bigfish.com (Postfix) with ESMTP id 63364A4F157; Fri, 30 Mar 2007 16:22:46 +0000 (UTC) Received: from mail9-fra-R.bigfish.com (unknown [10.4.252.3]) by outbound3-fra.bigfish.com (Postfix) with ESMTP id 61AE09B8043; Fri, 30 Mar 2007 16:22:46 +0000 (UTC) Received: from mail9-fra (localhost.localdomain [127.0.0.1]) by mail9-fra-R.bigfish.com (Postfix) with ESMTP id 53AA8250224; Fri, 30 Mar 2007 16:22:46 +0000 (UTC) X-BigFish: VP Received: by mail9-fra (MessageSwitch) id 1175271766264791_11162; Fri, 30 Mar 2007 16:22:46 +0000 (UCT) Received: from svlb1extmailp01.amd.com (unknown [139.95.251.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail9-fra.bigfish.com (Postfix) with ESMTP id B176D7D806D; Fri, 30 Mar 2007 16:22:45 +0000 (UTC) Received: from SSVLGW01.amd.com (ssvlgw01.amd.com [139.95.250.169]) by svlb1extmailp01.amd.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2UGLR4Y008094; Fri, 30 Mar 2007 09:22:42 -0700 Received: from 139.95.53.183 by SSVLGW02.amd.com with ESMTP (AMD SMTP Relay (Email Firewall v6.1.0)); Fri, 30 Mar 2007 08:22:37 -0800 X-Server-Uuid: 519AC16A-9632-469E-B354-112C592D09E8 Received: from ssvlexmb2.amd.com ([139.95.53.7]) by SSVLEXBH2.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Fri, 30 Mar 2007 09:22:37 -0700 Received: from SF36EXMB1.amd.com ([172.19.4.24]) by ssvlexmb2.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Fri, 30 Mar 2007 09:22:36 -0700 Received: from sefsexmb1.amd.com ([165.204.82.123]) by SF36EXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.2499); Fri, 30 Mar 2007 18:22:34 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 30 Mar 2007 18:21:57 +0200 Message-ID: <907625E08839C4409CE5768403633E0B018E1B66@sefsexmb1.amd.com> In-Reply-To: <200703301614.l2UGELDk030035@latara.uk.xensource.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Xen-staging] [xen-unstable] svm: Improve emulation of SMSW instruction for memory operands. Thread-Index: Acdy5ovwI7VMxSrsTlOEtlVS4Bsa2gAAEcDQ From: "Petersson, Mats" <Mats.Petersson@amd.com> To: xen-devel@lists.xensource.com, xen-staging@lists.xensource.com X-OriginalArrivalTime: 30 Mar 2007 16:22:34.0266 (UTC) FILETIME=[9F8517A0:01C772E7] X-WSS-ID: 6A13E6C72X04232892-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 62.209.45.174 X-SA-Exim-Mail-From: Mats.Petersson@amd.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] RE: [Xen-staging] [xen-unstable] svm: Improve emulation of SMSW instruction for memory operands. X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com =20> -----Original Message----- > From: xen-staging-bounces@lists.xensource.com=20 > [mailto:xen-staging-bounces@lists.xensource.com] On Behalf Of=20 > Xen staging patchbot-unstable > Sent: 30 March 2007 17:14 > To: xen-staging@lists.xensource.com > Subject: [Xen-staging] [xen-unstable] svm: Improve emulation=20 > of SMSW instruction for memory operands. >=20 > # HG changeset patch > # User Keir Fraser <keir@xensource.com> > # Date 1175271230 -3600 > # Node ID d3b1341d83db9445ef407cd50d7010b91f320043 > # Parent 3c0d15279dc7a5fae7b01c9d27abe0a31ddc0545 > svm: Improve emulation of SMSW instruction for memory operands. > From: Trolle Selander <trolle.selander@gmail.com> > Signed-off-by: Keir Fraser <keir@xensource.com> > --- > xen/arch/x86/hvm/svm/svm.c | 64=20 > ++++++++++++++++++++++++++++++++++++++++----- > 1 files changed, 58 insertions(+), 6 deletions(-) >=20 > diff -r 3c0d15279dc7 -r d3b1341d83db xen/arch/x86/hvm/svm/svm.c > --- a/xen/arch/x86/hvm/svm/svm.c Fri Mar 30 17:02:46 2007 +0100 > +++ b/xen/arch/x86/hvm/svm/svm.c Fri Mar 30 17:13:50 2007 +0100 > @@ -1866,11 +1866,13 @@ static int svm_cr_access(struct vcpu *v, > { > struct vmcb_struct *vmcb =3D v->arch.hvm_svm.vmcb; > int inst_len =3D 0; > - int index; > - unsigned int gpreg; > - unsigned long value; > + int index,addr_size,i; > + unsigned int gpreg,offset; > + unsigned long value,addr; > u8 buffer[MAX_INST_LEN]; =20 > u8 prefix =3D 0; > + u8 modrm; > + enum x86_segment seg; > int result =3D 1; > enum instruction_index list_a[] =3D {INSTR_MOV2CR,=20 > INSTR_CLTS, INSTR_LMSW}; > enum instruction_index list_b[] =3D {INSTR_MOVCR2, INSTR_SMSW}; > @@ -1931,9 +1933,59 @@ static int svm_cr_access(struct vcpu *v, > break; > =20 > case INSTR_SMSW: > - value =3D v->arch.hvm_svm.cpu_shadow_cr0; > - gpreg =3D decode_src_reg(prefix, buffer[index+2]); > - set_reg(gpreg, value, regs, vmcb); > + value =3D v->arch.hvm_svm.cpu_shadow_cr0 & 0xFFFF; > + modrm =3D buffer[index+2]; > + addr_size =3D svm_guest_x86_mode( v ); > + if ( likely((modrm & 0xC0) >> 6 =3D=3D 3) ) > + { > + gpreg =3D decode_src_reg(prefix, modrm); > + set_reg(gpreg, value, regs, vmcb); > + } > + /* > + * For now, only implement decode of the offset=20 > mode, since that''s the > + * only mode observed in a real-world OS. This code=20 > is also making the > + * assumption that we''ll never hit this code in long mode. > + */Shouldn''t such assumptions be checked by a "BUG_ON", "ASSERT" or similar? It doesn''t seem like difficult thing to check to me. And it''s heck of a lot easier to figure out why it went completely horribly wrong, than when the code just happily continues to execute, but in the wrong place or in some incorrect way? [I agree that there''s like 0.1% chance that someone uses SMSW in 64-bit mode, but it''s still a VALID instruction in that mode - and perhaps more importantly, it may be used in different addressing mode in 32-bit code.] -- Mats> + else if ( (modrm =3D=3D 0x26) || (modrm =3D=3D 0x25) ) > + { =20 > + seg =3D x86_seg_ds; > + i =3D index; > + /* Segment or address size overrides? */ > + while ( i-- ) > + { > + switch ( buffer[i] ) > + { > + case 0x26: seg =3D x86_seg_es; break; > + case 0x2e: seg =3D x86_seg_cs; break; > + case 0x36: seg =3D x86_seg_ss; break; > + case 0x64: seg =3D x86_seg_fs; break; > + case 0x65: seg =3D x86_seg_gs; break; > + case 0x67: addr_size ^=3D 6; break; > + } > + } > + /* Bail unless this really is a seg_base + offset case */ > + if ( ((modrm =3D=3D 0x26) && (addr_size =3D=3D 4)) || > + ((modrm =3D=3D 0x25) && (addr_size =3D=3D 2)) ) > + { > + gdprintk(XENLOG_ERR, "SMSW emulation at=20 > guest address: " > + "%lx failed due to unhandled=20 > addressing mode." > + "ModRM byte was: %x \n",=20 > svm_rip2pointer(v), modrm); > + domain_crash(v->domain); > + } > + inst_len +=3D addr_size; > + offset =3D *(( unsigned int *) ( void *)=20 > &buffer[index + 3]); > + offset =3D ( addr_size =3D=3D 4 ) ? offset : ( offset=20 > & 0xFFFF ); > + addr =3D hvm_get_segment_base(v, seg); > + addr +=3D offset; > + hvm_copy_to_guest_virt(addr,&value,2); > + } > + else > + { > + gdprintk(XENLOG_ERR, "SMSW emulation at guest=20 > address: %lx " > + "failed due to unhandled addressing mode!" > + "ModRM byte was: %x \n",=20 > svm_rip2pointer(v), modrm); > + domain_crash(v->domain); > + } > break; > =20 > default: >=20 > _______________________________________________ > Xen-staging mailing list > Xen-staging@lists.xensource.com > http://lists.xensource.com/xen-staging >=20 >=20 >=20_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 17:28:55 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 17:28:55 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXJyB-0006XU-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 17:28:55 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:33713 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXJxX-0006aB-6W (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 17:28:20 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXJyH-0002Au-Ih; Fri, 30 Mar 2007 16:29:01 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HWvq5-0001pB-5F for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:42:57 +0000 Received: from ccserver2.unican.es ([130.206.5.101] helo=mailhub2.unican.es) by lists.xensource.com with esmtp (Exim 4.50) id 1HWvpx-0008Nf-DE for xen-devel@lists.xensource.com; Thu, 29 Mar 2007 14:42:55 +0000 Received: from ccserver2.unican.es (ccserver2.unican.es [127.0.0.1]) by mailhub2.unican.es (Postfix) with ESMTP id 9C0AA1817B9 for <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 16:41:18 +0200 (CEST) Received: from boxer2.ifca.unican.es (boxer2.ifca.unican.es [193.144.210.25])by ccserver2.unican.es (Postfix) with ESMTP id 90A561815FBfor <xen-devel@lists.xensource.com>; Thu, 29 Mar 2007 16:41:16 +0200 (CEST) Received: from Turron ([193.144.209.17])by boxer2.ifca.unican.es (Sun ONE Messaging Server 6.0 Patch 1 (built Jan 282004)) with ESMTP id <0JFO005ZG659IR00@boxer2.ifca.unican.es> forxen-devel@lists.xensource.com; Thu, 29 Mar 2007 16:41:34 +0200 (CEST) Date: Thu, 29 Mar 2007 16:40:39 +0200 From: Philipp Fuchs <fuchs@ifca.unican.es> To: xen-devel@lists.xensource.com Message-id: <000c01c77210$387cba90$6e00000a@win.local> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Mailer: Microsoft Office Outlook 11 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Thread-index: AcdyEDgAF3LrFw8BTtyn5FsTfCPt7Q=X-imss-version: 2.046 X-imss-result: Passed X-imss-scanInfo: M:P L:E SM:0 X-imss-tmaseResult: TT:0 TS:0.0000 TC:00 TRN:0 TV:3.6.1039(15084.003) X-imss-scores: Clean:18.79718 C:2 M:3 S:5 R:5 X-imss-settings: Baseline:1 C:1 M:2 S:2 R:2 (0.0000 0.0000) X-SA-Exim-Connect-IP: 130.206.5.101 X-SA-Exim-Mail-From: fuchs@ifca.unican.es X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO, UNPARSEABLE_RELAY autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-Mailman-Approved-At: Fri, 30 Mar 2007 16:28:39 +0000 Subject: [Xen-devel] Error starting Windows VM X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Dear all, I write this email to you because the error message asks to do so. Up to know I didn''t have this problem while starting my Virtual machine of Windows Server 2003 x64. I think I will just reboot and see what happens. Kind regards, Philipp Fuchs --- Using config file "/etc/xen/w2k3.hvm". VNC= 1 Unexpected error: exceptions.OSError Please report to xen-devel@lists.xensource.com Traceback (most recent call last): File "/usr/sbin/xm", line 10, in ? main.main(sys.argv) File "//usr/lib64/python/xen/xm/main.py", line 1742, in main _, rc = _run_cmd(cmd, cmd_name, args) File "//usr/lib64/python/xen/xm/main.py", line 1766, in _run_cmd return True, cmd(args) File "<string>", line 1, in <lambda> File "//usr/lib64/python/xen/xm/main.py", line 1002, in xm_importcommand cmd.main([command] + args) File "//usr/lib64/python/xen/xm/create.py", line 1254, in main dom = make_domain(opts, config) File "//usr/lib64/python/xen/xm/create.py", line 1037, in make_domain os.kill(vncpid, signal.SIGKILL) --- ------------- Philipp Fuchs e-mail fuchs@ifca.unican.es Instituto de Fisica de Cantabria Ed. Juan Jorda, Campus UC, Avda Castros sn 39005, Santander, SPAIN _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 17:46:57 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 17:46:57 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXKFd-0007Mg-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 17:46:57 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.001, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:56012 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXKEh-0001Qy-Aw (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 17:46:04 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXKFS-00040Y-PV; Fri, 30 Mar 2007 16:46:46 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXKF1-0003iX-PH for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 16:46:19 +0000 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXKEy-0003uN-M7 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 16:46:17 +0000 Received: from m6.gw.fujitsu.co.jp ([10.0.50.76]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id l2UGj1ue018367 (envelope-from kanno.masaki@jp.fujitsu.com); Sat, 31 Mar 2007 01:45:02 +0900 Received: from smail (m6 [127.0.0.1]) by outgoing.m6.gw.fujitsu.co.jp (Postfix) with ESMTP id C3D6253C11D; Sat, 31 Mar 2007 01:45:01 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m6.gw.fujitsu.co.jp (Postfix) with ESMTP id 9A651240072; Sat, 31 Mar 2007 01:45:01 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4 [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 8AA4D161C006; Sat, 31 Mar 2007 01:45:01 +0900 (JST) Received: from fjm505.ms.jp.fujitsu.com (fjm505.ms.jp.fujitsu.com [10.56.99.83]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 2030E161C00A; Sat, 31 Mar 2007 01:45:01 +0900 (JST) Received: from fjmscan503.ms.jp.fujitsu.com (fjmscan503.ms.jp.fujitsu.com [10.56.99.143])by fjm505.ms.jp.fujitsu.com with ESMTP id l2UGiMwY020829; Sat, 31 Mar 2007 01:44:22 +0900 Received: from jp.fujitsu.com ([10.124.36.56]) by fjmscan503.ms.jp.fujitsu.com (8.13.1/8.12.11) with SMTP id l2UGiL8i025181; Sat, 31 Mar 2007 01:44:22 +0900 From: Masaki Kanno <kanno.masaki@jp.fujitsu.com> To: xen-devel@lists.xensource.com, ewan@xensource.com Date: Sat, 31 Mar 2007 01:44:20 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: HidemaruMail 4.63 (WinNT,501) In-Reply-To: <2C77086827ED1kanno.masaki@jp.fujitsu.com> References: <2C77086827ED1kanno.masaki@jp.fujitsu.com> Message-Id: <1DC772EAA9D5D3kanno.masaki@jp.fujitsu.com> X-SA-Exim-Connect-IP: 192.51.44.36 X-SA-Exim-Mail-From: kanno.masaki@jp.fujitsu.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] [PATCH] [Bug 936] Fix "cpus" in config.sxp X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Hi Ewan, Could you apply this patch? If without it, we must register domains by using the xm new command whenever we start xend. Or have you already prepared other patch which can solve this issue? If so, could you include it in Xen3.0.5? Best regards, Kan>Hi, > >I fixed the Xen bugzilla 936. >http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=936 > >Currently, "cpus" output to config.sxp is the following form. >Therefore _parse_sxp() cannot convert ''[1'' to integer. > > e.g. (cpus ''[1, 2]'') --- string > >This patch changes output form of "cpus". The form is as follows. > > e.g. (cpus (1 2)) > >However, the bug cannot be solved only by the change. When xend >is started, "cpus" of the SXP configuration passes to _parse_sxp() >in the following form. > > e.g. [''cpus'': [''1'', ''2'']] --- list of string > >Therefore this patch adds proceeding of to convert list of string >to list of integer for "cpus". > >Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com> > >Best regards, > Kan > > >-------------------------------text/plain------------------------------- >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 17:56:41 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 17:56:41 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXKP3-00079u-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 17:56:41 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:43705 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXKNT-0002lN-0X (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 17:55:08 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXKNw-0005ea-SG; Fri, 30 Mar 2007 16:55:32 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXKNV-0005LL-GV; Fri, 30 Mar 2007 16:55:05 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[Ap2TsoTlmSk2ukmKf34Ae3Xtme89Z6Rr]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXKNS-0004F9-27; Fri, 30 Mar 2007 16:55:03 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXKML-00075g-00; Fri, 30 Mar 2007 17:53:53 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 17:54:54 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: "Petersson, Mats" <Mats.Petersson@amd.com>, <xen-devel@lists.xensource.com>, <xen-staging@lists.xensource.com> Message-ID: <C232FF6E.52D3%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] RE: [Xen-staging] [xen-unstable] svm: Improve emulation of SMSW instruction for memory operands. Thread-Index: Acdy5ovwI7VMxSrsTlOEtlVS4Bsa2gAAEcDQAAFUMAsIn-Reply-To: <907625E08839C4409CE5768403633E0B018E1B66@sefsexmb1.amd.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] RE: [Xen-staging] [xen-unstable] svm: Improve emulation of SMSW instruction for memory operands. X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 17:21, "Petersson, Mats" <Mats.Petersson@amd.com> wrote:> Shouldn''t such assumptions be checked by a "BUG_ON", "ASSERT" or > similar? It doesn''t seem like difficult thing to check to me. And it''s > heck of a lot easier to figure out why it went completely horribly > wrong, than when the code just happily continues to execute, but in the > wrong place or in some incorrect way? > > [I agree that there''s like 0.1% chance that someone uses SMSW in 64-bit > mode, but it''s still a VALID instruction in that mode - and perhaps more > importantly, it may be used in different addressing mode in 32-bit > code.]It''s no worse than the code it replaces. Feel very free to send a patch. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 18:27:36 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 18:27:36 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXKsy-0007zV-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 18:27:36 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:47571 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXKs1-0004k5-7x (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 18:26:42 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXKsm-0006FT-4O; Fri, 30 Mar 2007 17:27:24 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXKsQ-0005uV-5t for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 17:27:02 +0000 Received: from cliff.cs.toronto.edu ([128.100.3.120]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXKsN-0004fE-Kj for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 17:27:00 +0000 Received: from [192.168.70.106] (plaxico.syslab.sandbox [192.168.70.106]) by cliff.cs.toronto.edu (Postfix) with ESMTP id CCF5A5FD08 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 13:25:48 -0400 (EDT) Message-ID: <460D4959.1030301@cs.toronto.edu> Date: Fri, 30 Mar 2007 13:31:05 -0400 From: Andres Lagar Cavilla <andreslc@cs.toronto.edu> User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: xen-devel@lists.xensource.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 128.100.3.120 X-SA-Exim-Mail-From: andreslc@cs.toronto.edu X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Room sharing @ Xen summit X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Hi, sorry for the spam. Send me an email if you''re going to the Xen summit and want to share costs on a hotel room. Andres _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 18:35:54 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 18:35:54 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXL10-0008Hg-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 18:35:54 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:49396 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXL0Z-0001qL-Ej (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 18:35:32 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXL1K-0006pK-Oa; Fri, 30 Mar 2007 17:36:14 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXL0w-0006XN-W1 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 17:35:50 +0000 Received: from e32.co.us.ibm.com ([32.97.110.150]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXL0s-0004iC-6H for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 17:35:48 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.11.20060308/8.13.8) with ESMTP id l2UHWWXA002989 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 13:32:32 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UHYZ7c177104 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 11:34:35 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UHYZ1H021038 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 11:34:35 -0600 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UHYYeF021002 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 11:34:34 -0600 Received: by localhost.localdomain (Postfix, from userid 1000) id B26FA1BF92; Fri, 30 Mar 2007 12:34:32 -0500 (CDT) Date: Fri, 30 Mar 2007 12:34:32 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: xen-devel@lists.xensource.com Message-ID: <20070330173432.GR28736@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-SA-Exim-Connect-IP: 32.97.110.150 X-SA-Exim-Mail-From: ryanh@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] numa=on broken X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Testing the latest xen-unstable bits, booting with numa=on fails: (XEN) Command line: /boot/xen.gz com1=115200,8n1 console=com1 conswitch=x numa=on (XEN) Physical RAM map: (XEN) 0000000000000000 - 000000000009d000 (usable) (XEN) 000000000009dc00 - 00000000000a0000 (reserved) (XEN) 00000000000d0000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 00000000dff60000 (usable) (XEN) 00000000dff60000 - 00000000dff72000 (ACPI data) (XEN) 00000000dff72000 - 00000000dff80000 (ACPI NVS) (XEN) 00000000dff80000 - 00000000e0000000 (reserved) (XEN) 00000000fec00000 - 00000000fec00400 (reserved) (XEN) 00000000fee00000 - 00000000fee01000 (reserved) (XEN) 00000000fff80000 - 0000000100000000 (reserved) (XEN) 0000000100000000 - 0000000200000000 (usable) (XEN) System RAM: 7678MB (7863284kB) (XEN) ACPI: RSDP (v002 PTLTD ) @ 0x00000000000f7170 (XEN) ACPI: XSDT (v001 PTLTD XSDT 0x06040000 LTP 0x00000000) @ 0x00000000dff6d116 (XEN) ACPI: FADT (v003 AMD HAMMER 0x06040000 PTEC 0x000f4240) @ 0x00000000dff71d0f (XEN) ACPI: SRAT (v001 AMD HAMMER 0x06040000 AMD 0x00000001) @ 0x00000000dff71e03 (XEN) ACPI: MADT (v001 PTLTD APIC 0x06040000 LTP 0x00000000) @ 0x00000000dff71ecb (XEN) ACPI: ASF! (v016 MBI CETP 0x06040000 PTL 0x00000001) @ 0x00000000dff71f59 (XEN) ACPI: DSDT (v001 AMD-K8 AMDACPI 0x06040000 MSFT 0x0100000e) @ 0x0000000000000000 (XEN) SRAT: PXM 0 -> APIC 0 -> Node 0 (XEN) SRAT: PXM 1 -> APIC 1 -> Node 1 (XEN) SRAT: Node 0 PXM 0 0-a0000 (XEN) SRAT: Node 0 PXM 0 0-e0000000 (XEN) SRAT: Node 1 PXM 1 100000000-200000000 (XEN) NUMA: Using 32 for the hash shift. (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 2! (XEN) Reserving non-aligned node boundary @ mfn 1048576 (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 2! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 2! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 2! (XEN) Unknown interrupt Looking a little deeper, it looks like in end_boot_allocator() we are attempting to dynamically allocate memory for addition arrays in avail[] and for the heap. This uses xmalloc() which relies on alloc_xenheap_pages() to work. alloc_xenheap_pages() can''t function until end_boot_allocator() completes. Prior to end_boot_alloctor(), one needs to use alloc_boot_pages(). Any thoughts on how to proceed here? -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 19:04:04 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:04:04 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXLSG-0008QC-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:04:04 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:50656 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXLRl-0001mR-Bn (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 19:03:39 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXLSV-0007Ja-Mb; Fri, 30 Mar 2007 18:04:19 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXLS9-00071K-FZ for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:03:57 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[c9Hsr2RvAmHcD9bFMkeONChb3tp44Poa]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXLS6-00057E-U3 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:03:55 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXLF0-0008AN-00; Fri, 30 Mar 2007 18:50:22 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 18:51:22 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Ryan Harper <ryanh@us.ibm.com>, <xen-devel@lists.xensource.com> Message-ID: <C2330CAA.52DF%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] numa=on broken Thread-Index: Acdy9AcYRV2Nht7nEdusYQAWy6hiGQ=In-Reply-To: <20070330173432.GR28736@us.ibm.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] numa=on broken X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 18:34, "Ryan Harper" <ryanh@us.ibm.com> wrote:> Looking a little deeper, it looks like in end_boot_allocator() we are > attempting to dynamically allocate memory for addition arrays in avail[] > and for the heap. This uses xmalloc() which relies on > alloc_xenheap_pages() to work. alloc_xenheap_pages() can''t function > until end_boot_allocator() completes. Prior to end_boot_alloctor(), one > needs to use alloc_boot_pages(). > > Any thoughts on how to proceed here?Since the buddy allocators are initialised with memory from address zero upwards, I would expect everything to work fine if numa node zero always owns the first block of physical memory. This is because we statically allocate space for heap metadata for numa node zero (since even non-numa machines have a ''numa node zero''), so by the time you need to allocate memory for other numa nodes you''re xenheap will be populated with memory. So -- can we ensure that the node that owns low memory is node zero? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 19:08:44 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:08:44 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXLWm-0008Um-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:08:44 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:55005 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXLWL-0003Pe-7g (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 19:08:22 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXLX5-0007lq-Pl; Fri, 30 Mar 2007 18:09:03 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXLWk-0007Ta-8S for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:08:42 +0000 Received: from e5.ny.us.ibm.com ([32.97.182.145]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXLWg-00058e-Eu for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:08:40 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e5.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UI7NuO000539 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 14:07:24 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UI6vf9306220 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 14:06:57 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UI6vwf018201 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 14:06:57 -0400 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UI6vrl018136; Fri, 30 Mar 2007 14:06:57 -0400 Received: by localhost.localdomain (Postfix, from userid 1000) id 003441BF92; Fri, 30 Mar 2007 13:06:54 -0500 (CDT) Date: Fri, 30 Mar 2007 13:06:54 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Ryan Harper <ryanh@us.ibm.com> Message-ID: <20070330180654.GS28736@us.ibm.com> References: <20070330173432.GR28736@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070330173432.GR28736@us.ibm.com> User-Agent: Mutt/1.5.6+20040907i X-SA-Exim-Connect-IP: 32.97.182.145 X-SA-Exim-Mail-From: ryanh@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] numa=on broken X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com * Ryan Harper <ryanh@us.ibm.com> [2007-03-30 12:37]:> Testing the latest xen-unstable bits, booting with numa=on fails: > > (XEN) Command line: /boot/xen.gz com1=115200,8n1 console=com1 conswitch=x numa=on > (XEN) Physical RAM map: > (XEN) 0000000000000000 - 000000000009d000 (usable) > (XEN) 000000000009dc00 - 00000000000a0000 (reserved) > (XEN) 00000000000d0000 - 0000000000100000 (reserved) > (XEN) 0000000000100000 - 00000000dff60000 (usable) > (XEN) 00000000dff60000 - 00000000dff72000 (ACPI data) > (XEN) 00000000dff72000 - 00000000dff80000 (ACPI NVS) > (XEN) 00000000dff80000 - 00000000e0000000 (reserved) > (XEN) 00000000fec00000 - 00000000fec00400 (reserved) > (XEN) 00000000fee00000 - 00000000fee01000 (reserved) > (XEN) 00000000fff80000 - 0000000100000000 (reserved) > (XEN) 0000000100000000 - 0000000200000000 (usable) > (XEN) System RAM: 7678MB (7863284kB) > (XEN) ACPI: RSDP (v002 PTLTD ) @ 0x00000000000f7170 > (XEN) ACPI: XSDT (v001 PTLTD XSDT 0x06040000 LTP 0x00000000) @ 0x00000000dff6d116 > (XEN) ACPI: FADT (v003 AMD HAMMER 0x06040000 PTEC 0x000f4240) @ 0x00000000dff71d0f > (XEN) ACPI: SRAT (v001 AMD HAMMER 0x06040000 AMD 0x00000001) @ 0x00000000dff71e03 > (XEN) ACPI: MADT (v001 PTLTD APIC 0x06040000 LTP 0x00000000) @ 0x00000000dff71ecb > (XEN) ACPI: ASF! (v016 MBI CETP 0x06040000 PTL 0x00000001) @ 0x00000000dff71f59 > (XEN) ACPI: DSDT (v001 AMD-K8 AMDACPI 0x06040000 MSFT 0x0100000e) @ 0x0000000000000000 > (XEN) SRAT: PXM 0 -> APIC 0 -> Node 0 > (XEN) SRAT: PXM 1 -> APIC 1 -> Node 1 > (XEN) SRAT: Node 0 PXM 0 0-a0000 > (XEN) SRAT: Node 0 PXM 0 0-e0000000 > (XEN) SRAT: Node 1 PXM 1 100000000-200000000 > (XEN) NUMA: Using 32 for the hash shift. > (XEN) Cannot handle page request order 0! > (XEN) Cannot handle page request order 2! > (XEN) Reserving non-aligned node boundary @ mfn 1048576 > (XEN) Cannot handle page request order 0! > (XEN) Cannot handle page request order 2! > (XEN) Cannot handle page request order 0! > (XEN) Cannot handle page request order 2! > (XEN) Cannot handle page request order 0! > (XEN) Cannot handle page request order 2! > (XEN) Unknown interrupt > > Looking a little deeper, it looks like in end_boot_allocator() we are > attempting to dynamically allocate memory for addition arrays in avail[]actually, that is in init_heap_pages() which is called by end_boot_allocator(). -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 19:10:27 2007 Return-path: <ryanh@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:10:27 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXLYQ-0000KZ-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:10:26 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.479, DNS_FROM_RFC_ABUSE 0.48) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from e2.ny.us.ibm.com ([32.97.182.142]:52711) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HXLWx-0001Pn-Pg (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <ryanh@us.ibm.com>); Fri, 30 Mar 2007 19:08:56 +0100 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UI8r7p027321 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:08:53 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UI8re1274170 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:08:53 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UI8rNH032533 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:08:53 -0400 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UI8rG6032525; Fri, 30 Mar 2007 14:08:53 -0400 Received: by localhost.localdomain (Postfix, from userid 1000) id 138B51BF92; Fri, 30 Mar 2007 13:08:53 -0500 (CDT) Date: Fri, 30 Mar 2007 13:08:53 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: Ryan Harper <ryanh@us.ibm.com>, xen-devel@lists.xensource.com Subject: Re: [Xen-devel] numa=on broken Message-ID: <20070330180853.GT28736@us.ibm.com> References: <20070330173432.GR28736@us.ibm.com> <C2330CAA.52DF%Keir.Fraser@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <C2330CAA.52DF%Keir.Fraser@cl.cam.ac.uk> User-Agent: Mutt/1.5.6+20040907i * Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2007-03-30 13:06]:> On 30/3/07 18:34, "Ryan Harper" <ryanh@us.ibm.com> wrote: > > > Looking a little deeper, it looks like in end_boot_allocator() we are > > attempting to dynamically allocate memory for addition arrays in avail[] > > and for the heap. This uses xmalloc() which relies on > > alloc_xenheap_pages() to work. alloc_xenheap_pages() can''t function > > until end_boot_allocator() completes. Prior to end_boot_alloctor(), one > > needs to use alloc_boot_pages(). > > > > Any thoughts on how to proceed here? > > Since the buddy allocators are initialised with memory from address zero > upwards, I would expect everything to work fine if numa node zero always > owns the first block of physical memory. This is because we statically > allocate space for heap metadata for numa node zero (since even non-numa > machines have a ''numa node zero''), so by the time you need to allocate > memory for other numa nodes you''re xenheap will be populated with memory. > > So -- can we ensure that the node that owns low memory is node zero?AFAIK, that is the case, look at the SRAT table: (XEN) SRAT: Node 0 PXM 0 0-a0000 (XEN) SRAT: Node 0 PXM 0 0-e0000000 (XEN) SRAT: Node 1 PXM 1 100000000-200000000 -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com From xen-devel-bounces.xensource.com Fri Mar 30 19:17:44 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:17:44 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXLfU-0000Dt-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:17:44 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:54214 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXLf5-0006sR-7t (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 19:17:24 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXLfr-0008Va-0c; Fri, 30 Mar 2007 18:18:07 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXLfT-0008DA-C2 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:17:43 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[qA6PNqR7NxR+VxYe6DYJVEZ415x3MkTQ]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXLfO-0005C5-Rv for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:17:41 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXLeG-0000CB-00; Fri, 30 Mar 2007 19:16:28 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 19:17:30 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Ryan Harper <ryanh@us.ibm.com> Message-ID: <C23312CA.52E9%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] numa=on broken Thread-Index: Acdy962y7B7hRN7qEdusYQAWy6hiGQ=In-Reply-To: <20070330180853.GT28736@us.ibm.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] numa=on broken X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 19:08, "Ryan Harper" <ryanh@us.ibm.com> wrote:>> So -- can we ensure that the node that owns low memory is node zero? > > AFAIK, that is the case, look at the SRAT table: > > (XEN) SRAT: Node 0 PXM 0 0-a0000 > (XEN) SRAT: Node 0 PXM 0 0-e0000000 > (XEN) SRAT: Node 1 PXM 1 100000000-200000000What if you move end_boot_allocator() to just before ''early_boot = 0'' in arch/x86/setup.c? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 19:21:22 2007 Return-path: <ryanh@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:21:22 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXLj0-0000Hn-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:21:22 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.479, DNS_FROM_RFC_ABUSE 0.48) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from e32.co.us.ibm.com ([32.97.110.150]:49750) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXLij-0001dC-DE (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <ryanh@us.ibm.com>); Fri, 30 Mar 2007 19:21:05 +0100 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.12.11.20060308/8.13.8) with ESMTP id l2UIIvxN009958 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:18:57 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UIKxO5148620 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 12:20:59 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UIKxVJ010461 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 12:20:59 -0600 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UIKxVi010449; Fri, 30 Mar 2007 12:20:59 -0600 Received: by localhost.localdomain (Postfix, from userid 1000) id E0EBD1BF92; Fri, 30 Mar 2007 13:20:58 -0500 (CDT) Date: Fri, 30 Mar 2007 13:20:58 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] numa=on broken Message-ID: <20070330182058.GU28736@us.ibm.com> References: <20070330180853.GT28736@us.ibm.com> <C23312CA.52E9%Keir.Fraser@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <C23312CA.52E9%Keir.Fraser@cl.cam.ac.uk> User-Agent: Mutt/1.5.6+20040907i * Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2007-03-30 13:17]:> > > > On 30/3/07 19:08, "Ryan Harper" <ryanh@us.ibm.com> wrote: > > >> So -- can we ensure that the node that owns low memory is node zero? > > > > AFAIK, that is the case, look at the SRAT table: > > > > (XEN) SRAT: Node 0 PXM 0 0-a0000 > > (XEN) SRAT: Node 0 PXM 0 0-e0000000 > > (XEN) SRAT: Node 1 PXM 1 100000000-200000000 > > What if you move end_boot_allocator() to just before ''early_boot = 0'' in > arch/x86/setup.c?Giving that a shot. Debugging shows confirms that we are looking at node0 memory which should have already been initialized in the allocator: (XEN) NUMA: Using 32 for the hash shift. (XEN) attempting to xmalloc_array() avail for NODE1 (XEN) alloc_xenheap_pages: Requesting MEMZONE_XEN, cpu0, order->0 (XEN) alloc_heap_pages: attempting to allocate in zone(0,0), cpu0, node0, order->0 (XEN) Cannot handle page request order 0! -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com From xen-devel-bounces.xensource.com Fri Mar 30 19:46:56 2007 Return-path: <ryanh@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:46:56 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXM7j-0000l0-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:46:55 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.479, DNS_FROM_RFC_ABUSE 0.48) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from e33.co.us.ibm.com ([32.97.110.151]:47147) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXM7M-0007hd-1K (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <ryanh@us.ibm.com>); Fri, 30 Mar 2007 19:46:32 +0100 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e33.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UIkRWK007762 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:46:27 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UIkQWo200922 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 12:46:26 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UIkQZv002320 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 12:46:26 -0600 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UIkQDZ002306; Fri, 30 Mar 2007 12:46:26 -0600 Received: by localhost.localdomain (Postfix, from userid 1000) id A85131BF92; Fri, 30 Mar 2007 13:46:20 -0500 (CDT) Date: Fri, 30 Mar 2007 13:46:20 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] numa=on broken Message-ID: <20070330184620.GV28736@us.ibm.com> References: <20070330180853.GT28736@us.ibm.com> <C23312CA.52E9%Keir.Fraser@cl.cam.ac.uk> <20070330182058.GU28736@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070330182058.GU28736@us.ibm.com> User-Agent: Mutt/1.5.6+20040907i * Ryan Harper <ryanh@us.ibm.com> [2007-03-30 13:36]:> * Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2007-03-30 13:17]: > > > > > > > > On 30/3/07 19:08, "Ryan Harper" <ryanh@us.ibm.com> wrote: > > > > >> So -- can we ensure that the node that owns low memory is node zero? > > > > > > AFAIK, that is the case, look at the SRAT table: > > > > > > (XEN) SRAT: Node 0 PXM 0 0-a0000 > > > (XEN) SRAT: Node 0 PXM 0 0-e0000000 > > > (XEN) SRAT: Node 1 PXM 1 100000000-200000000 > > > > What if you move end_boot_allocator() to just before ''early_boot = 0'' in > > arch/x86/setup.c? > > Giving that a shot.Didn''t work, just pushes the bubble back to allocating the array for NODE0: (XEN) SRAT: Node 0 PXM 0 0-a0000 (XEN) SRAT: Node 0 PXM 0 0-e0000000 (XEN) SRAT: Node 1 PXM 1 100000000-200000000 (XEN) NUMA: Using 32 for the hash shift. (XEN) done with numa_initmem_init() (XEN) attempting to xmalloc_array() avail for NODE0 (XEN) Cannot handle page request order 0! (XEN) attempting to xmalloc() for heap for NODE0 (XEN) Cannot handle page request order 2! That is, we are still dying in init_heap_pages(), but this time for allocating avail[0] rather than avail[1]. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com From xen-devel-bounces.xensource.com Fri Mar 30 19:49:06 2007 Return-path: <ryanh@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:49:06 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXM9q-0000nA-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:49:06 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.479, DNS_FROM_RFC_ABUSE 0.48) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from e34.co.us.ibm.com ([32.97.110.152]:45034) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HXM9c-0003mP-Uv (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <ryanh@us.ibm.com>); Fri, 30 Mar 2007 19:48:52 +0100 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UImmG2029849 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:48:48 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UImljk166582 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 12:48:47 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UIml1c011844 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 12:48:47 -0600 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UImlBf011838; Fri, 30 Mar 2007 12:48:47 -0600 Received: by localhost.localdomain (Postfix, from userid 1000) id 5DBFD1BF92; Fri, 30 Mar 2007 13:48:42 -0500 (CDT) Date: Fri, 30 Mar 2007 13:48:42 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Ryan Harper <ryanh@us.ibm.com> Cc: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>, xen-devel@lists.xensource.com Subject: Re: [Xen-devel] numa=on broken Message-ID: <20070330184842.GW28736@us.ibm.com> References: <20070330180853.GT28736@us.ibm.com> <C23312CA.52E9%Keir.Fraser@cl.cam.ac.uk> <20070330182058.GU28736@us.ibm.com> <20070330184620.GV28736@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070330184620.GV28736@us.ibm.com> User-Agent: Mutt/1.5.6+20040907i * Ryan Harper <ryanh@us.ibm.com> [2007-03-30 13:46]:> * Ryan Harper <ryanh@us.ibm.com> [2007-03-30 13:36]: > > * Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2007-03-30 13:17]: > > > > > > > > > > > > On 30/3/07 19:08, "Ryan Harper" <ryanh@us.ibm.com> wrote: > > > > > > >> So -- can we ensure that the node that owns low memory is node zero? > > > > > > > > AFAIK, that is the case, look at the SRAT table: > > > > > > > > (XEN) SRAT: Node 0 PXM 0 0-a0000 > > > > (XEN) SRAT: Node 0 PXM 0 0-e0000000 > > > > (XEN) SRAT: Node 1 PXM 1 100000000-200000000 > > > > > > What if you move end_boot_allocator() to just before ''early_boot = 0'' in > > > arch/x86/setup.c? > > > > Giving that a shot. > > Didn''t work, just pushes the bubble back to allocating the array for > NODE0:Ah, top of end_boot_allocator assings avail[0] to avail0. Looks like there is some heap/avail initiliazation that needs to be done seperately. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com From xen-devel-bounces.xensource.com Fri Mar 30 19:52:09 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:52:09 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMCn-00014D-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:52:09 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:34740 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXMBy-0006y9-6S (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 19:51:24 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMCi-0001oG-F9; Fri, 30 Mar 2007 18:52:04 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMCJ-0001VW-1h for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:51:39 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[/RuNfiYHIcViM2CkFR0nWQbo3GWhyPm3]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXMCG-0005ix-HI for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:51:36 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMB8-0000oa-00; Fri, 30 Mar 2007 19:50:26 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 19:51:27 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Ryan Harper <ryanh@us.ibm.com> Message-ID: <C2331ABF.52F4%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] numa=on broken Thread-Index: Acdy/GvYqqjQTt7vEdusYQAWy6hiGQ=In-Reply-To: <20070330184620.GV28736@us.ibm.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] numa=on broken X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 19:46, "Ryan Harper" <ryanh@us.ibm.com> wrote:> That is, we are still dying in init_heap_pages(), but this time for > allocating avail[0] rather than avail[1].In addition to that change in x86/setup.c, move the first three lines of code from end_boot_allocator() into init_xenheap_pages() (these are the ones that actually set up the statically allocated node0 metadata). If that works I''ll sort out a clean fix. This is just a simple exercise in code shuffling. :-) -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 19:54:23 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:54:23 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMEx-00016n-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:54:23 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.255, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:44294 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HXMEc-00063N-U2 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 19:54:07 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMFM-0002Ai-CF; Fri, 30 Mar 2007 18:54:48 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMEw-0001sN-4w for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:54:22 +0000 Received: from mga09.intel.com ([134.134.136.24]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXMEt-0005xq-42 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 18:54:20 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by mga09.intel.com with ESMTP; 30 Mar 2007 11:53:03 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by fmsmga002.fm.intel.com with ESMTP; 30 Mar 2007 11:53:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,354,1170662400"; d="asc''?scan''208,217"; a="66562170:sNHT46493469" Received: from scsmsx412.amr.corp.intel.com ([10.3.90.31]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 30 Mar 2007 11:53:02 -0700 Received: from 143.183.140.150 ([143.183.140.150]) by scsmsx412.amr.corp.intel.com ([10.3.90.31]) via Exchange Front-End Server email.intel.com ([192.168.65.22]) with Microsoft Exchange Server HTTP-DAV ; Fri, 30 Mar 2007 18:53:02 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Received: from lnitindesktop by email.intel.com; 30 Mar 2007 11:53:02 -0700 Content-class: urn:content-classes:message Date: Fri, 30 Mar 2007 11:53:01 -0700 Message-ID: <1175280781.32115.13.camel@lnitindesktop.sc.intel.com> In-Reply-To: <460C8207.8000604@us.ibm.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH][RFC] Emulating real mode with x86_emulate Thread-Index: Acdy/KSfVC01akGpSxmaXMN5aMlB4Q=References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> <460C8207.8000604@us.ibm.com> From: "Kamble, Nitin A" <nitin.a.kamble@intel.com> To: "Anthony Liguori" <aliguori@us.ibm.com> X-OriginalArrivalTime: 30 Mar 2007 18:53:02.0735 (UTC) FILETIME=[A4E821F0:01C772FC] X-SA-Exim-Connect-IP: 134.134.136.24 X-SA-Exim-Mail-From: nitin.a.kamble@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,HTML_50_60, HTML_MESSAGE,RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============1153693488==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --===============1153693488=Content-Type: multipart/signed; boundary="=-Z7YCJFSn2dbNyt3U0hiM"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-Z7YCJFSn2dbNyt3U0hiM Content-Type: multipart/alternative; boundary="=-l818IGBd2Ik8imTBSyPs" --=-l818IGBd2Ik8imTBSyPs Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2007-03-29 at 22:20 -0500, Anthony Liguori wrote:> > ... =20 > > (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. >=20 > The Triple fault you''re seeing here is terribly curious. Also the=20 > "deadbeef" output. Just to sanity check, I threw the following printk=20 > in vmcs.c >=20Anthony, To me the tripple fault makes sense.=20 Your patch enables emulation only when "emulating" is set to 1. void arch_vmx_do_resume(struct vcpu *v) { if ( v->arch.hvm_vmx.active_cpu =3D=3D smp_processor_id() ) @@ -508,7 +644,11 @@ void arch_vmx_do_resume(struct vcpu *v) } =20 hvm_do_resume(v); - reset_stack_and_jump(vmx_asm_do_vmentry); + + if (v->arch.hvm_vmx.emulating) + vmx_do_emulate(v); + else + reset_stack_and_jump(vmx_asm_do_vmentry); } And it is turned on only when guest (hvmloader) sets up CR0. -static int vmx_set_cr0(unsigned long value) +int vmx_set_cr0(unsigned long value) { struct vcpu *v =3D current; unsigned long mfn; @@ -1982,13 +1982,29 @@ static int vmx_set_cr0(unsigned long val } } - if ( vmx_assist(v, VMX_ASSIST_INVOKE) ) + if ( v->arch.hvm_vcpu.emulate_realmode ) + { + eip =3D __vmread(GUEST_RIP); + HVM_DBG_LOG(DBG_LEVEL_1, + "Transfering control to x86_emulate %%eip 0x%lx \n", eip); + v->arch.hvm_vmx.emulating =3D 1; + return 1; + } + else if ( vmx_assist(v, VMX_ASSIST_INVOKE) ) { And I don''t see any code in the hvmloader for setting cr0 before returning from the main. So the code flow is returning from main, which is causing the tripple fault. I observe the vmx_do_emulate is never getting called. I think set cr0 instruction is needed just after the emulate_realmode hypercall in the hvmloader code. Have you added more code lateron after sending the patch out? Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it''s open.=20> while (!hypercall_preempt_check()) { > + printk("eip =3D 0x%x\n", regs->eip); > if (x86_emulate(&ctxt, &em_ops)) { >=20 > And I get the following output with a FC5 guest: >=20 > (XEN)=20 > hvmop_emulate_realmode =20 > (XEN) guest requests real mode=20 > emulation =20 > (XEN) foo=20 > 221 =20 > (XEN) eip =3D=20 > 0xd338d =20 > (XEN) eip =3D=20 > 0xd338e =20 > (XEN) eip =3D=20 > 0xffbf0000 =20 > (XEN) failed to emulate instruction at %eip =3D=20 > 0xd338d =20 > (XEN) domain_crash_sync called from=20 > vmcs.c:625 =20 > (XEN) Domain 1 (vcpu#0) crashed on=20 > cpu#0: =20 > (XEN) ----[ Xen-3.0-unstable x86_32 debug=3Dn Not tainted=20 > ]---- =20 > (XEN) CPU: =20 > 0 =20 > (XEN) EIP: =20 > 0010:[<000d338d>] =20 > (XEN) EFLAGS: 00000002 CONTEXT:=20 > hvm =20 > (XEN) eax: 00000076 ebx: 000d7324 ecx: 000d7324 edx:=20 > 000000e9 =20 > (XEN) esi: 000d4e54 edi: 000d3380 ebp: 000d72a8 esp:=20 > 000d72a8 =20 > (XEN) cr0: 00050032 cr4: 00000651 cr3: 00000000 cr2:=20 > 00000000 =20 > (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0018 cs: 0010 =20 >=20 > So, perhaps it''s the guest you''re using? Clearly, we''re running in=20 > x86_emulate and hitting a 16 bit instruction we can''t handle. N.B. the=20 > printk in the error path for x86_emulate is wrong. I should be looking=20 > at regs->eip, not GUEST_RIP since that wouldn''t have been updated again. >=20 > Regards, >=20 > Anthony Liguori--=-l818IGBd2Ik8imTBSyPs Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8"> <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.3"> </HEAD> <BODY> On Thu, 2007-03-29 at 22:20 -0500, Anthony Liguori wrote: <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000">> ... </FONT> <FONT COLOR=3D"#000000">> (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset.</FONT> <FONT COLOR=3D"#000000">The Triple fault you''re seeing here is terribly curious. Also the </FONT> <FONT COLOR=3D"#000000">"deadbeef" output. Just to sanity check, I threw the following printk </FONT> <FONT COLOR=3D"#000000">in vmcs.c</FONT> </PRE> </BLOCKQUOTE> <BR> Anthony,<BR> To me the tripple fault makes sense. <BR> <BR> Your patch enables emulation only when "emulating" is set to 1.<BR> <BR> <BR> void arch_vmx_do_resume(struct vcpu *v)<BR> {<BR> if ( v->arch.hvm_vmx.active_cpu =3D=3D smp_processor_id() )<BR> @@ -508,7 +644,11 @@ void arch_vmx_do_resume(struct vcpu *v)<BR> }<BR> <BR> hvm_do_resume(v);<BR> - reset_stack_and_jump(vmx_asm_do_vmentry);<BR> +<BR> + if (v->arch.hvm_vmx.emulating)<BR> + vmx_do_emulate(v);<BR> + else<BR> + reset_stack_and_jump(vmx_asm_do_vmentry);<BR> }<BR> <BR> <BR> And it is turned on only when guest (hvmloader) sets up CR0.<BR> <BR> -static int vmx_set_cr0(unsigned long value)<BR> +int vmx_set_cr0(unsigned long value)<BR> {<BR> struct vcpu *v =3D current;<BR> unsigned long mfn;<BR> @@ -1982,13 +1982,29 @@ static int vmx_set_cr0(unsigned long val<BR> }<BR> }<BR> <BR> - if ( vmx_assist(v, VMX_ASSIST_INVOKE) )<BR> + if ( v->arch.hvm_vcpu.emulate_realmode )<BR> + {<BR> + eip =3D __vmread(GUEST_RIP);<BR> + HVM_DBG_LOG(DBG_LEVEL_1,<BR> + "Transfering control to x86_emulate %%eip 0x%lx\n", eip);<BR> + v->arch.hvm_vmx.emulating =3D 1;<BR> + return 1;<BR> + }<BR> + else if ( vmx_assist(v, VMX_ASSIST_INVOKE) )<BR> {<BR> <BR> And I don''t see any code in the hvmloader for setting cr0 before returning from the main.<BR> <BR> So the code flow is returning from main, which is causing the tripple fault.<BR> <BR> I observe the vmx_do_emulate is never getting called.<BR> <BR> I think set cr0 instruction is needed just after the emulate_realmode hypercall in the hvmloader code.<BR> <BR> Have you added more code lateron after sending the patch out?<BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> <BR> <BR> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000"> while (!hypercall_preempt_check()) {</FONT> <FONT COLOR=3D"#000000">+ printk("eip =3D 0x%x\n", regs->eip);</FONT> <FONT COLOR=3D"#000000"> if (x86_emulate(&ctxt, &em_ops)) {</FONT> <FONT COLOR=3D"#000000">And I get the following output with a FC5 guest:</FONT> <FONT COLOR=3D"#000000">(XEN) </FONT> <FONT COLOR=3D"#000000">hvmop_emulate_realmode </FONT> <FONT COLOR=3D"#000000">(XEN) guest requests real mode </FONT> <FONT COLOR=3D"#000000">emulation </FONT> <FONT COLOR=3D"#000000">(XEN) foo </FONT> <FONT COLOR=3D"#000000">221 </FONT> <FONT COLOR=3D"#000000">(XEN) eip =3D </FONT> <FONT COLOR=3D"#000000">0xd338d </FONT> <FONT COLOR=3D"#000000">(XEN) eip =3D </FONT> <FONT COLOR=3D"#000000">0xd338e </FONT> <FONT COLOR=3D"#000000">(XEN) eip =3D </FONT> <FONT COLOR=3D"#000000">0xffbf0000 </FONT> <FONT COLOR=3D"#000000">(XEN) failed to emulate instruction at %eip =3D </FONT> <FONT COLOR=3D"#000000">0xd338d </FONT> <FONT COLOR=3D"#000000">(XEN) domain_crash_sync called from </FONT> <FONT COLOR=3D"#000000">vmcs.c:625 </FONT> <FONT COLOR=3D"#000000">(XEN) Domain 1 (vcpu#0) crashed on </FONT> <FONT COLOR=3D"#000000">cpu#0: </FONT> <FONT COLOR=3D"#000000">(XEN) ----[ Xen-3.0-unstable x86_32 debug=3Dn Not tainted </FONT> <FONT COLOR=3D"#000000">]---- </FONT> <FONT COLOR=3D"#000000">(XEN) CPU: </FONT> <FONT COLOR=3D"#000000">0 </FONT> <FONT COLOR=3D"#000000">(XEN) EIP: </FONT> <FONT COLOR=3D"#000000">0010:[<000d338d>] </FONT> <FONT COLOR=3D"#000000">(XEN) EFLAGS: 00000002 CONTEXT: </FONT> <FONT COLOR=3D"#000000">hvm </FONT> <FONT COLOR=3D"#000000">(XEN) eax: 00000076 ebx: 000d7324 ecx: 000d7324 edx: </FONT> <FONT COLOR=3D"#000000">000000e9 </FONT> <FONT COLOR=3D"#000000">(XEN) esi: 000d4e54 edi: 000d3380 ebp: 000d72a8 esp: </FONT> <FONT COLOR=3D"#000000">000d72a8 </FONT> <FONT COLOR=3D"#000000">(XEN) cr0: 00050032 cr4: 00000651 cr3: 00000000 cr2: </FONT> <FONT COLOR=3D"#000000">00000000 </FONT> <FONT COLOR=3D"#000000">(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0018 cs: 0010 </FONT> <FONT COLOR=3D"#000000">So, perhaps it''s the guest you''re using? Clearly, we''re running in </FONT> <FONT COLOR=3D"#000000">x86_emulate and hitting a 16 bit instruction we can''t handle. N.B. the </FONT> <FONT COLOR=3D"#000000">printk in the error path for x86_emulate is wrong. I should be looking </FONT> <FONT COLOR=3D"#000000">at regs->eip, not GUEST_RIP since that wouldn''t have been updated again.</FONT> <FONT COLOR=3D"#000000">Regards,</FONT> <FONT COLOR=3D"#000000">Anthony Liguori</FONT> </PRE> </BLOCKQUOTE> <BR> </BODY> </HTML> --=-l818IGBd2Ik8imTBSyPs-- --=-Z7YCJFSn2dbNyt3U0hiM Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGDVyNZ1sfU7kTCR8RAnVeAJ9ERSNhpgoAcMpvHW6VUfk5j4mKyACePl5g OYttSFsBJDkgIyCCRTo5YeU=jZWR -----END PGP SIGNATURE----- --=-Z7YCJFSn2dbNyt3U0hiM-- --===============1153693488=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1153693488==-- From xen-devel-bounces.xensource.com Fri Mar 30 19:56:07 2007 Return-path: <ryanh@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 19:56:07 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMGd-000182-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 19:56:07 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from e4.ny.us.ibm.com ([32.97.182.144]:35680) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXMG8-00028n-FG (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <ryanh@us.ibm.com>); Fri, 30 Mar 2007 19:55:36 +0100 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UItX7g026585 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:55:33 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UItXfU286606 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:55:33 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UItX8B014011 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 14:55:33 -0400 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UItXoG014005; Fri, 30 Mar 2007 14:55:33 -0400 Received: by localhost.localdomain (Postfix, from userid 1000) id 0C2901BF95; Fri, 30 Mar 2007 13:55:33 -0500 (CDT) Date: Fri, 30 Mar 2007 13:55:33 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] numa=on broken Message-ID: <20070330185533.GX28736@us.ibm.com> References: <20070330184620.GV28736@us.ibm.com> <C2331ABF.52F4%Keir.Fraser@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <C2331ABF.52F4%Keir.Fraser@cl.cam.ac.uk> User-Agent: Mutt/1.5.6+20040907i * Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2007-03-30 13:52]:> > > > On 30/3/07 19:46, "Ryan Harper" <ryanh@us.ibm.com> wrote: > > > That is, we are still dying in init_heap_pages(), but this time for > > allocating avail[0] rather than avail[1]. > > In addition to that change in x86/setup.c, move the first three lines of > code from end_boot_allocator() into init_xenheap_pages() (these are the ones > that actually set up the statically allocated node0 metadata). If that works > I''ll sort out a clean fix. > > This is just a simple exercise in code shuffling. :-)Giving that try right now, let you know in a fewl. I would have rather had the folks who changed the code actually test with numa=on. What are you thoughts about turning numa on by default or at least getting a numa=on run on a two-socket opteron in the xen-rt regressions. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com From xen-devel-bounces.xensource.com Fri Mar 30 20:01:37 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 20:01:37 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMLx-00010S-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 20:01:37 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:52795 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXMLT-00040s-G5 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 20:01:13 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMME-0002uQ-JB; Fri, 30 Mar 2007 19:01:54 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMLo-0002cM-Ev for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 19:01:28 +0000 Received: from e33.co.us.ibm.com ([32.97.110.151]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXMLl-000608-8X for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 19:01:26 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UJ0E2T031722 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 15:00:14 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UJ0EGC069930 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 13:00:14 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UJ0DqA017962 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 13:00:14 -0600 Received: from [9.53.41.158] (rhesus.austin.ibm.com [9.53.41.158]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UJ0562017293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Mar 2007 13:00:11 -0600 Message-ID: <460D5E34.2080803@us.ibm.com> Date: Fri, 30 Mar 2007 14:00:04 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: "Kamble, Nitin A" <nitin.a.kamble@intel.com> References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> <460C8207.8000604@us.ibm.com> <1175280781.32115.13.camel@lnitindesktop.sc.intel.com> In-Reply-To: <1175280781.32115.13.camel@lnitindesktop.sc.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.110.151 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Kamble, Nitin A wrote:> On Thu, 2007-03-29 at 22:20 -0500, Anthony Liguori wrote: >> > ... >> > (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. >> >> The Triple fault you''re seeing here is terribly curious. Also the >> "deadbeef" output. Just to sanity check, I threw the following printk >> in vmcs.c >> >> > > Anthony, > To me the tripple fault makes sense. > > Your patch enables emulation only when "emulating" is set to 1. > > > void arch_vmx_do_resume(struct vcpu *v) > { > if ( v->arch.hvm_vmx.active_cpu == smp_processor_id() ) > @@ -508,7 +644,11 @@ void arch_vmx_do_resume(struct vcpu *v) > } > > hvm_do_resume(v); > - reset_stack_and_jump(vmx_asm_do_vmentry); > + > + if (v->arch.hvm_vmx.emulating) > + vmx_do_emulate(v); > + else > + reset_stack_and_jump(vmx_asm_do_vmentry); > } > > > And it is turned on only when guest (hvmloader) sets up CR0. > > -static int vmx_set_cr0(unsigned long value) > +int vmx_set_cr0(unsigned long value) > { > struct vcpu *v = current; > unsigned long mfn; > @@ -1982,13 +1982,29 @@ static int vmx_set_cr0(unsigned long val > } > } > > - if ( vmx_assist(v, VMX_ASSIST_INVOKE) ) > + if ( v->arch.hvm_vcpu.emulate_realmode ) > + { > + eip = __vmread(GUEST_RIP); > + HVM_DBG_LOG(DBG_LEVEL_1, > + "Transfering control to x86_emulate %%eip > 0x%lx\n", eip); > + v->arch.hvm_vmx.emulating = 1; > + return 1; > + } > + else if ( vmx_assist(v, VMX_ASSIST_INVOKE) ) > { > > And I don''t see any code in the hvmloader for setting cr0 before > returning from the main.My tip is 14462:3fd9b0c71b8c and in hvmloader.c, there is: asm( " .text \n" " .globl _start \n" "_start: \n" /* C runtime kickoff. */ " cld \n" " cli \n" " movl $stack_top,%esp \n" " movl %esp,%ebp \n" " call main \n" /* Relocate real-mode trampoline to 0x0. */ " mov $trampoline_start,%esi \n" " xor %edi,%edi \n" " mov $trampoline_end,%ecx \n" " sub %esi,%ecx \n" " rep movsb \n" <snip> /* Enter real mode, reload all segment registers and IDT. */ " ljmp $0x8,$0x0 \n" "trampoline_start: .code16 \n" " mov %eax,%cr0 \n" That change was pretty recent so unless it was reverted it should Just Work. Regards, Anthony Liguori> So the code flow is returning from main, which is causing the tripple > fault. > > I observe the vmx_do_emulate is never getting called. > > I think set cr0 instruction is needed just after the emulate_realmode > hypercall in the hvmloader code. > > Have you added more code lateron after sending the patch out? > > Thanks & Regards, > Nitin > Open Source Technology Center, Intel Corporation. > ------------------------------------------------------------------------- > The mind is like a parachute; it works much better when it''s open. > > > >> while (!hypercall_preempt_check()) { >> + printk("eip = 0x%x\n", regs->eip); >> if (x86_emulate(&ctxt, &em_ops)) { >> >> And I get the following output with a FC5 guest: >> >> (XEN) >> hvmop_emulate_realmode >> (XEN) guest requests real mode >> emulation >> (XEN) foo >> 221 >> (XEN) eip = >> 0xd338d >> (XEN) eip = >> 0xd338e >> (XEN) eip = >> 0xffbf0000 >> (XEN) failed to emulate instruction at %eip = >> 0xd338d >> (XEN) domain_crash_sync called from >> vmcs.c:625 >> (XEN) Domain 1 (vcpu#0) crashed on >> cpu#0: >> (XEN) ----[ Xen-3.0-unstable x86_32 debug=n Not tainted >> ]---- >> (XEN) CPU: >> 0 >> (XEN) EIP: >> 0010:[<000d338d>] >> (XEN) EFLAGS: 00000002 CONTEXT: >> hvm >> (XEN) eax: 00000076 ebx: 000d7324 ecx: 000d7324 edx: >> 000000e9 >> (XEN) esi: 000d4e54 edi: 000d3380 ebp: 000d72a8 esp: >> 000d72a8 >> (XEN) cr0: 00050032 cr4: 00000651 cr3: 00000000 cr2: >> 00000000 >> (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0018 cs: 0010 >> >> So, perhaps it''s the guest you''re using? Clearly, we''re running in >> x86_emulate and hitting a 16 bit instruction we can''t handle. N.B. the >> printk in the error path for x86_emulate is wrong. I should be looking >> at regs->eip, not GUEST_RIP since that wouldn''t have been updated again. >> >> Regards, >> >> Anthony Liguori >> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 20:04:32 2007 Return-path: <ryanh@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 20:04:32 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMOm-00014t-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 20:04:32 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.479, DNS_FROM_RFC_ABUSE 0.48) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from e1.ny.us.ibm.com ([32.97.182.141]:37777) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HXMOM-0004sO-NH (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <ryanh@us.ibm.com>); Fri, 30 Mar 2007 20:04:06 +0100 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UJ40kY006085 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 15:04:00 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UJ40Xx303852 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 15:04:00 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UJ3x9B032690 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 15:03:59 -0400 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UJ3xqO032673; Fri, 30 Mar 2007 15:03:59 -0400 Received: by localhost.localdomain (Postfix, from userid 1000) id 064F51BF92; Fri, 30 Mar 2007 14:03:59 -0500 (CDT) Date: Fri, 30 Mar 2007 14:03:59 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: Ryan Harper <ryanh@us.ibm.com>, xen-devel@lists.xensource.com Subject: Re: [Xen-devel] numa=on broken Message-ID: <20070330190358.GY28736@us.ibm.com> References: <20070330184620.GV28736@us.ibm.com> <C2331ABF.52F4%Keir.Fraser@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <C2331ABF.52F4%Keir.Fraser@cl.cam.ac.uk> User-Agent: Mutt/1.5.6+20040907i * Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2007-03-30 13:53]:> > > > On 30/3/07 19:46, "Ryan Harper" <ryanh@us.ibm.com> wrote: > > > That is, we are still dying in init_heap_pages(), but this time for > > allocating avail[0] rather than avail[1]. > > In addition to that change in x86/setup.c, move the first three lines of > code from end_boot_allocator() into init_xenheap_pages() (these are the ones > that actually set up the statically allocated node0 metadata). If that works > I''ll sort out a clean fix. > > This is just a simple exercise in code shuffling. :-)That works. Shuffle away. =) When you have a patch, send it my way and I''ll give it a spin to confirm. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com From xen-devel-bounces.xensource.com Fri Mar 30 20:09:11 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 20:09:11 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMTH-00018w-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 20:09:11 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:58027 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXMSz-0002DM-8U (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 20:08:58 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMTl-0004Yv-FI; Fri, 30 Mar 2007 19:09:41 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMTL-0004GE-V3 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 19:09:15 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[C1AtB6tlPEzC2daCVOm9VNgxClzTFAI4]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXMTJ-000636-3W for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 19:09:13 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMOJ-000147-00; Fri, 30 Mar 2007 20:04:03 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Fri, 30 Mar 2007 20:05:04 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Ryan Harper <ryanh@us.ibm.com> Message-ID: <C2331DF0.52FC%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] numa=on broken Thread-Index: Acdy/lLQkZZxfN7xEdusYQAWy6hiGQ=In-Reply-To: <20070330185533.GX28736@us.ibm.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] numa=on broken X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 19:55, "Ryan Harper" <ryanh@us.ibm.com> wrote:>> This is just a simple exercise in code shuffling. :-) > > Giving that try right now, let you know in a fewl. > > I would have rather had the folks who changed the code actually test > with numa=on. > > What are you thoughts about turning numa on by default or at least > getting a numa=on run on a two-socket opteron in the xen-rt regressions.Turning on by default is pointless because guests are not restricted to running on specific nodes by default. Since manual intervention is required to achieve that (right now at least) requiring numa=on is not much of a hardship. Integration with xenrt is perhaps possible but we are constrained by machine resources. Numa=on has been broken for over a month and noone else had yet complained so it doesn''t seem to be a priority for many people. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 20:39:04 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 20:39:04 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMwC-0001rv-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 20:39:04 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:58813 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXMvr-0006dH-DA (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 20:38:48 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMwb-0005gV-3X; Fri, 30 Mar 2007 19:39:29 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXMwB-0005J7-NK for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 19:39:03 +0000 Received: from mcclure-nat.wal.novell.com ([130.57.22.22] helo=mcclure.wal.novell.com) by lists.xensource.com with esmtp (Exim 4.50) id 1HXMw7-0006RF-0y for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 19:39:01 +0000 Received: from WALTHAM-MTA by mcclure.wal.novell.com with Novell_GroupWise; Fri, 30 Mar 2007 15:37:45 -0400 Message-Id: <460D11D4.D169.003C.0@novell.com> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Fri, 30 Mar 2007 15:37:41 -0400 From: "Charles Coffing" <ccoffing@novell.com> To: <xen-devel@lists.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part51761715.0__=" X-SA-Exim-Connect-IP: 130.57.22.22 X-SA-Exim-Mail-From: ccoffing@novell.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] [PATCH] hang in qcow2raw X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --=__Part51761715.0__Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, We hit a bug in which qcow2raw would hang the conversion just short of 100%, because the final write queue was never being submitted. If a blktap drivers read synchronously, then "submit_events" and "complete" variables are checked before getting set, so the fact that reads have finished is not noticed, so the final write queue was never submitted. Note that I have also removed the variables write_complete and read_complete. They were unused, and they were also not set correctly in the synchronous case. Patch attached; please apply to xen-unstable. Thanks. Signed-off-by: Charles Coffing <ccoffing@novell.com> --=__Part51761715.0__Content-Type: text/plain; name="qcow2raw-hang.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qcow2raw-hang.patch" --- a/tools/blktap/drivers/qcow2raw.c 2007-03-12 09:01:04.000000000 -0600 +++ b/tools/blktap/drivers/qcow2raw.c 2007-03-30 13:07:57.000000000 -0600 @@ -51,7 +51,6 @@ #define BLOCK_PROCESSSZ 4096 =20 static int maxfds, *qcowio_fd, *aio_fd, running =3D 1, complete =3D 0;=20 -static int read_complete =3D 0, write_complete =3D 0; static int returned_read_events =3D 0, returned_write_events =3D 0; static int submit_events =3D 0; static uint32_t read_idx =3D 0, write_idx =3D 0; @@ -109,8 +108,6 @@ written +=3D BLOCK_PROCESSSZ; returned_write_events++; write_idx =3D idx; - if (complete && (returned_write_events =3D=3D submit_events))=20 - write_complete =3D 1; =20 debug_output(written, dd->td_state->size << 9); free(private); @@ -126,8 +123,6 @@ =09 returned_read_events++; read_idx =3D idx; - if (complete && (returned_read_events =3D=3D submit_events))=20 - read_complete =3D 1; =09 ret =3D ddaio.drv->td_queue_write(&ddaio, idx, BLOCK_PROCESSSZ>>9, private,=20 send_write_responses, idx, private); @@ -136,7 +131,7 @@ return 0; } =20 - if ( (complete && returned_read_events =3D=3D submit_events) ||=20 + if ( (returned_read_events =3D=3D submit_events) ||=20 (returned_read_events % 10 =3D=3D 0) ) { ddaio.drv->td_submit(&ddaio); } @@ -299,6 +294,7 @@ } =09 /*Attempt to read 4k sized blocks*/ + submit_events++; ret =3D ddqcow.drv->td_queue_read(&ddqcow, i>>9, BLOCK_PROCESSSZ>>9, buf,=20 send_read_responses, i>>9, buf); @@ -309,7 +305,6 @@ exit(-1); } else { i +=3D BLOCK_PROCESSSZ; - submit_events++; } =20 if (i >=3D ddqcow.td_state->size<<9) { --=__Part51761715.0__Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part51761715.0__=-- From xen-devel-bounces.xensource.com Fri Mar 30 20:40:27 2007 Return-path: <ryanh@us.ibm.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 20:40:27 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXMxX-0001kI-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 20:40:27 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0.479, DNS_FROM_RFC_ABUSE 0.48) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from e32.co.us.ibm.com ([32.97.110.150]:41068) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXMxG-0007Wk-AE (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <ryanh@us.ibm.com>); Fri, 30 Mar 2007 20:40:11 +0100 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.12.11.20060308/8.13.8) with ESMTP id l2UJbvNX015910 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 15:37:57 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UJdxdW200246 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 13:40:00 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UJdxtn031114 for <Keir.Fraser@cl.cam.ac.uk>; Fri, 30 Mar 2007 13:39:59 -0600 Received: from localhost.localdomain (frylock.austin.ibm.com [9.53.41.12]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UJdwFd031074; Fri, 30 Mar 2007 13:39:58 -0600 Received: by localhost.localdomain (Postfix, from userid 1000) id 502C41BF92; Fri, 30 Mar 2007 14:39:58 -0500 (CDT) Date: Fri, 30 Mar 2007 14:39:58 -0500 From: Ryan Harper <ryanh@us.ibm.com> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] numa=on broken Message-ID: <20070330193958.GZ28736@us.ibm.com> References: <20070330185533.GX28736@us.ibm.com> <C2331DF0.52FC%Keir.Fraser@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <C2331DF0.52FC%Keir.Fraser@cl.cam.ac.uk> User-Agent: Mutt/1.5.6+20040907i * Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2007-03-30 14:10]:> On 30/3/07 19:55, "Ryan Harper" <ryanh@us.ibm.com> wrote: > > >> This is just a simple exercise in code shuffling. :-) > > > > Giving that try right now, let you know in a fewl. > > > > I would have rather had the folks who changed the code actually test > > with numa=on. > > > > What are you thoughts about turning numa on by default or at least > > getting a numa=on run on a two-socket opteron in the xen-rt regressions. > > Turning on by default is pointless because guests are not restricted to > running on specific nodes by default. Since manual intervention is required > to achieve that (right now at least) requiring numa=on is not much of a > hardship.I''m getting ready to re-submit patches to export the topology information so the userspace tools can use that info to make intelligent selections. This was available back in October, but was never picked up, or even commented upon.> > Integration with xenrt is perhaps possible but we are constrained by machine > resources. Numa=on has been broken for over a month and noone else had yet > complained so it doesn''t seem to be a priority for many people.I spent a bit of last week pointing out to folks that NUMA was available as it was never announced in the 3.0.4 release [1]notes AFAICT. It may be that the community wasn''t aware that it was there to even test. It is indeed important to IBM and I''ve spoken with folks at AMD who have expressed support for ensuring solid NUMA support in Xen. In any case, thanks for the quick work on fixing this issue. 1. http://xensource.com/download/index_3.0.4.html -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com From xen-devel-bounces.xensource.com Fri Mar 30 22:10:12 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 22:10:12 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXOMO-00030d-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 22:10:12 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.255, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:44770 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HXOLr-0007RO-Pc (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 22:09:45 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXOMb-00089l-0P; Fri, 30 Mar 2007 21:10:25 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXOMD-0007sA-14 for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 21:10:01 +0000 Received: from mga03.intel.com ([143.182.124.21]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXOM9-0007aT-Vn for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 21:09:58 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 30 Mar 2007 14:08:41 -0700 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by azsmga001.ch.intel.com with ESMTP; 30 Mar 2007 14:08:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,355,1170662400"; d="asc''?scan''208,217"; a="205805206:sNHT53364752" Received: from scsmsx412.amr.corp.intel.com ([10.3.90.31]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 30 Mar 2007 14:08:34 -0700 Received: from 143.183.140.150 ([143.183.140.150]) by scsmsx412.amr.corp.intel.com ([10.3.90.31]) via Exchange Front-End Server email.intel.com ([192.168.65.22]) with Microsoft Exchange Server HTTP-DAV ; Fri, 30 Mar 2007 21:08:33 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Received: from lnitindesktop by email.intel.com; 30 Mar 2007 14:08:33 -0700 Content-class: urn:content-classes:message Date: Fri, 30 Mar 2007 14:08:33 -0700 Message-ID: <1175288913.32115.20.camel@lnitindesktop.sc.intel.com> In-Reply-To: <460D5E34.2080803@us.ibm.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH][RFC] Emulating real mode with x86_emulate Thread-Index: AcdzD5Nuzxl09DrGRYOdur+odFmM+Q=References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> <460C8207.8000604@us.ibm.com> <1175280781.32115.13.camel@lnitindesktop.sc.intel.com> <460D5E34.2080803@us.ibm.com> From: "Kamble, Nitin A" <nitin.a.kamble@intel.com> To: "Anthony Liguori" <aliguori@us.ibm.com> X-OriginalArrivalTime: 30 Mar 2007 21:08:34.0235 (UTC) FILETIME=[93A890B0:01C7730F] X-SA-Exim-Connect-IP: 143.182.124.21 X-SA-Exim-Mail-From: nitin.a.kamble@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0251414070==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --===============0251414070=Content-Type: multipart/signed; boundary="=-Mw86ASY+XrrkQhA2BBUJ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-Mw86ASY+XrrkQhA2BBUJ Content-Type: multipart/alternative; boundary="=-yubwWM7stL1B8J8h6Y/H" --=-yubwWM7stL1B8J8h6Y/H Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Anthony, On Fri, 2007-03-30 at 14:00 -0500, Anthony Liguori wrote:> /* Enter real mode, reload all segment registers and IDT. */ > " ljmp $0x8,$0x0 \n" > "trampoline_start: .code16 \n" > " mov %eax,%cr0 \n" >=20 > That change was pretty recent so unless it was reverted it should Just Work. >=20 > Regards, >=20 > Anthony LiguoriNow I see cr0 is updated after returning from main.=20 I enabled the debug log in the xen code now. (XEN) HVM2: Creating MP tables ... =20 (XEN) HVM2: Loading Cirrus VGABIOS ... =20 (XEN) HVM2: Loading ACPI ... =20 (XEN) HVM2: Loading VMXAssist ... deadbeef =20 (XEN) HVM2: foo =20 (XEN) hvmop_emulate_realmode =20 (XEN) guest requests real mode emulation =20 (XEN) foo 221 =20 (XEN) HVM2: Invoking ROMBIOS ... =20 (XEN) vmx_vmexit_handler called. eip =3D 0x0 =20 (XEN) vmx_cr_access called eip=3D0x0 =20 (XEN) mov_to_cr 0 called eip=3D0x0 =20 (XEN) vmx_set_cr0 called eip=3D0x0 =20 (XEN) Transfering -- control to x86_emulate eip 0x0 =20 (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. =20 It shows cr0 is getting modified. But the eip is still 0x0.=20 =20 Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it''s open.=20 --=-yubwWM7stL1B8J8h6Y/H Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8"> <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.3"> </HEAD> <BODY> Hi Anthony,<BR> <BR> On Fri, 2007-03-30 at 14:00 -0500, Anthony Liguori wrote: <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000"> /* Enter real mode, reload all segment registers and IDT. */</FONT> <FONT COLOR=3D"#000000"> " ljmp $0x8,$0x0 \n"</FONT> <FONT COLOR=3D"#000000"> "trampoline_start: .code16 \n"</FONT> <FONT COLOR=3D"#000000"> " mov %eax,%cr0 \n"</FONT> <FONT COLOR=3D"#000000">That change was pretty recent so unless it was reverted it should Just Work.</FONT> <FONT COLOR=3D"#000000">Regards,</FONT> <FONT COLOR=3D"#000000">Anthony Liguori</FONT> </PRE> </BLOCKQUOTE> Now I see cr0 is updated after returning from main. <BR> I enabled the debug log in the xen code now.<BR> <BR> (XEN) HVM2: Creating MP tables ... <BR> (XEN) HVM2: Loading Cirrus VGABIOS ... <BR> (XEN) HVM2: Loading ACPI ... <BR> (XEN) HVM2: Loading VMXAssist ... deadbeef <BR> (XEN) HVM2: foo <BR> (XEN) hvmop_emulate_realmode <BR> (XEN) guest requests real mode emulation <BR> (XEN) foo 221 <BR> (XEN) HVM2: Invoking ROMBIOS ... <BR> (XEN) vmx_vmexit_handler called. eip =3D 0x0 <BR> (XEN) vmx_cr_access called eip=3D0x0 <BR> (XEN) mov_to_cr 0 called eip=3D0x0 <BR> (XEN) vmx_set_cr0 called eip=3D0x0 <BR> (XEN) Transfering -- control to x86_emulate eip 0x0 <BR> (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. <BR> <BR> It shows cr0 is getting modified. But the eip is still 0x0. <BR> <BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> </BODY> </HTML> --=-yubwWM7stL1B8J8h6Y/H-- --=-Mw86ASY+XrrkQhA2BBUJ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGDXxRZ1sfU7kTCR8RAu7JAJ0QiTfTjFAtNWkE2w+35Dto1bOHFACfZM/y OKVvZoNR+f/3eZg9uqO9w9o=2FbC -----END PGP SIGNATURE----- --=-Mw86ASY+XrrkQhA2BBUJ-- --===============0251414070=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0251414070==-- From xen-devel-bounces.xensource.com Fri Mar 30 22:21:58 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 22:21:58 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXOXm-0003Fk-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 22:21:58 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:33602 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXOXV-0004Dm-EY (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 22:21:46 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXOYD-0000AY-Rj; Fri, 30 Mar 2007 21:22:25 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXOXn-0008K3-9N for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 21:21:59 +0000 Received: from e34.co.us.ibm.com ([32.97.110.152]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXOXk-0007lX-Ao for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 21:21:57 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2ULKjr4002690 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 17:20:45 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2ULKiRJ138814 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 15:20:44 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2ULKisA027048 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 15:20:44 -0600 Received: from [9.53.41.158] (rhesus.austin.ibm.com [9.53.41.158]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2ULKcQ9026772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Mar 2007 15:20:44 -0600 Message-ID: <460D7F26.2080809@us.ibm.com> Date: Fri, 30 Mar 2007 16:20:38 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: Andi Kleen <andi@firstfloor.org> References: <4607074E.1030807@us.ibm.com> <p73mz1uqt5q.fsf@bingen.suse.de> In-Reply-To: <p73mz1uqt5q.fsf@bingen.suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.110.152 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Andi Kleen wrote:> Anthony Liguori <aliguori@us.ibm.com> writes: > > >> Attached is a patch that begins to lay down the infrastructure for >> emulating real mode with x86_emulate(). With a little more >> refactoring, I think it could also replace the SVM emulator. >> > > I thought the roadmap direction of this was to migrate the context > into qemu and let its JIT handle it? Or has that been dropped? >There are some hard problems with migrating into QEMU. Namely, the code that QEMU generates isn''t SMP safe (atomic instructions lose their atomicity). Regards, Anthony Liguori> -Andi >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 22:26:33 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 22:26:33 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXOcD-0003KW-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 22:26:33 +0100 X-Cam-SpamScore: s X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=1.255, HTML_MESSAGE 0.00, RCVD_NUMERIC_HELO 1.25, UNPARSEABLE_RELAY 0.00) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:59729 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HXObc-0008Bv-O3 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 22:26:01 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXOcO-0000eD-8V; Fri, 30 Mar 2007 21:26:44 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXOby-0000KF-5v for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 21:26:18 +0000 Received: from mga03.intel.com ([143.182.124.21]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXObv-0007wH-6T for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 21:26:16 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 30 Mar 2007 14:25:04 -0700 Received: from fmsmsx333.amr.corp.intel.com ([132.233.42.2]) by azsmga001.ch.intel.com with ESMTP; 30 Mar 2007 14:25:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,355,1170662400"; d="asc''?scan''208,217"; a="205811957:sNHT43568056" Received: from scsmsx412.amr.corp.intel.com ([10.3.90.31]) by fmsmsx333.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 30 Mar 2007 14:24:47 -0700 Received: from 143.183.140.150 ([143.183.140.150]) by scsmsx412.amr.corp.intel.com ([10.3.90.31]) via Exchange Front-End Server email.intel.com ([192.168.65.22]) with Microsoft Exchange Server HTTP-DAV ; Fri, 30 Mar 2007 21:24:46 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Received: from lnitindesktop by email.intel.com; 30 Mar 2007 14:24:46 -0700 Content-class: urn:content-classes:message Date: Fri, 30 Mar 2007 14:24:46 -0700 Message-ID: <1175289886.32115.26.camel@lnitindesktop.sc.intel.com> In-Reply-To: <1175288913.32115.20.camel@lnitindesktop.sc.intel.com> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [PATCH][RFC] Emulating real mode with x86_emulate Thread-Index: AcdzEddA7h4+OLjASEuuqK9G3KWq9g=References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> <460C8207.8000604@us.ibm.com> <1175280781.32115.13.camel@lnitindesktop.sc.intel.com> <460D5E34.2080803@us.ibm.com> <1175288913.32115.20.camel@lnitindesktop.sc.intel.com> From: "Kamble, Nitin A" <nitin.a.kamble@intel.com> To: "Anthony Liguori" <aliguori@us.ibm.com> X-OriginalArrivalTime: 30 Mar 2007 21:24:47.0465 (UTC) FILETIME=[D7BFAD90:01C77311] X-SA-Exim-Connect-IP: 143.182.124.21 X-SA-Exim-Mail-From: nitin.a.kamble@intel.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY autolearn=no version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Content-Type: multipart/mixed; boundary="===============0537366310==" Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --===============0537366310=Content-Type: multipart/signed; boundary="=-+ytRGW3NwQ8RM8HFFBcy"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-class: urn:content-classes:message --=-+ytRGW3NwQ8RM8HFFBcy Content-Type: multipart/alternative; boundary="=-uhYQ2q3+QGooJRTeY3Nk" --=-uhYQ2q3+QGooJRTeY3Nk Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Anthony, eip of 0x0 is the right address. Because the trampoline_Start code is relocated to address 0. /* Relocate real-mode trampoline to 0x0. */ " mov $trampoline_start,%esi \n" " xor %edi,%edi \n" " mov $trampoline_end,%ecx \n" " sub %esi,%ecx \n" " rep movsb \n" Still there is no progress in the emulation. The guest is dying with triple-fault just like before. Thanks & Regards, Nitin=20 Open Source Technology Center, Intel Corporation. ------------------------------------------------------------------------- The mind is like a parachute; it works much better when it''s open.=20 On Fri, 2007-03-30 at 14:08 -0700, Nitin A Kamble wrote:> Hi Anthony, >=20 > On Fri, 2007-03-30 at 14:00 -0500, Anthony Liguori wrote:=20 >=20 > > /* Enter real mode, reload all segment registers and IDT. */ > > " ljmp $0x8,$0x0 \n" > > "trampoline_start: .code16 \n" > > " mov %eax,%cr0 \n" > >=20 > > That change was pretty recent so unless it was reverted it should Just Work. > >=20 > > Regards, > >=20 > > Anthony Liguori >=20 > Now I see cr0 is updated after returning from main.=20 > I enabled the debug log in the xen code now. >=20 > (XEN) HVM2: Creating MP > tables ... =20 > (XEN) HVM2: Loading Cirrus > VGABIOS ... =20 > (XEN) HVM2: Loading > ACPI ... =20 > (XEN) HVM2: Loading VMXAssist ... > deadbeef =20 > (XEN) HVM2: > foo =20 > (XEN) > hvmop_emulate_realmode =20 > (XEN) guest requests real mode > emulation =20 > (XEN) foo > 221 =20 > (XEN) HVM2: Invoking > ROMBIOS ... =20 > (XEN) vmx_vmexit_handler called. eip =3D > 0x0 =20 > (XEN) vmx_cr_access called > eip=3D0x0 =20 > (XEN) mov_to_cr 0 called > eip=3D0x0 =20 > (XEN) vmx_set_cr0 called > eip=3D0x0 =20 > (XEN) Transfering -- control to x86_emulate eip > 0x0 =20 > (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system > reset. =20 >=20 > It shows cr0 is getting modified. But the eip is still 0x0.=20 >=20 >=20 > Thanks & Regards, > Nitin=20 > Open Source Technology Center, Intel Corporation. > ------------------------------------------------------------------------- > The mind is like a parachute; it works much better when it''s open.=20--=-uhYQ2q3+QGooJRTeY3Nk Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8"> <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.3"> </HEAD> <BODY> Anthony,<BR> eip of 0x0 is the right address.<BR> <BR> Because the trampoline_Start code is relocated to address 0.<BR> <BR> /* Relocate real-mode trampoline to 0x0. */<BR> " mov $trampoline_start,%esi \n"<BR> " xor %edi,%edi \n"<BR> " mov $trampoline_end,%ecx \n"<BR> " sub %esi,%ecx \n"<BR> " rep movsb \n"<BR> <BR> Still there is no progress in the emulation. The guest is dying with triple-fault just like before.<BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> <BR> On Fri, 2007-03-30 at 14:08 -0700, Nitin A Kamble wrote:<BR> <BLOCKQUOTE TYPE=3DCITE> <FONT COLOR=3D"#000000">Hi Anthony,</FONT><BR> <BR> <FONT COLOR=3D"#000000">On Fri, 2007-03-30 at 14:00 -0500, Anthony Liguori wrote: </FONT> <BLOCKQUOTE TYPE=3DCITE> <PRE> <FONT COLOR=3D"#000000"> /* Enter real mode, reload all segment registers and IDT. */</FONT> <FONT COLOR=3D"#000000"> " ljmp $0x8,$0x0 \n"</FONT> <FONT COLOR=3D"#000000"> "trampoline_start: .code16 \n"</FONT> <FONT COLOR=3D"#000000"> " mov %eax,%cr0 \n"</FONT> <FONT COLOR=3D"#000000">That change was pretty recent so unless it was reverted it should Just Work.</FONT> <FONT COLOR=3D"#000000">Regards,</FONT> <FONT COLOR=3D"#000000">Anthony Liguori</FONT> </PRE> </BLOCKQUOTE> <FONT COLOR=3D"#000000">Now I see cr0 is updated after returning from main. </FONT><BR> <FONT COLOR=3D"#000000"> I enabled the debug log in the xen code now.</FONT><BR> <BR> <FONT COLOR=3D"#000000">(XEN) HVM2: Creating MP tables ... </FONT><BR> <FONT COLOR=3D"#000000">(XEN) HVM2: Loading Cirrus VGABIOS ... </FONT><BR> <FONT COLOR=3D"#000000">(XEN) HVM2: Loading ACPI ... </FONT><BR> <FONT COLOR=3D"#000000">(XEN) HVM2: Loading VMXAssist ... deadbeef </FONT><BR> <FONT COLOR=3D"#000000">(XEN) HVM2: foo </FONT><BR> <FONT COLOR=3D"#000000">(XEN) hvmop_emulate_realmode </FONT><BR> <FONT COLOR=3D"#000000">(XEN) guest requests real mode emulation </FONT><BR> <FONT COLOR=3D"#000000">(XEN) foo 221 </FONT><BR> <FONT COLOR=3D"#000000">(XEN) HVM2: Invoking ROMBIOS ... </FONT><BR> <FONT COLOR=3D"#000000">(XEN) vmx_vmexit_handler called. eip =3D 0x0 </FONT><BR> <FONT COLOR=3D"#000000">(XEN) vmx_cr_access called eip=3D0x0 </FONT><BR> <FONT COLOR=3D"#000000">(XEN) mov_to_cr 0 called eip=3D0x0 </FONT><BR> <FONT COLOR=3D"#000000">(XEN) vmx_set_cr0 called eip=3D0x0 </FONT><BR> <FONT COLOR=3D"#000000">(XEN) Transfering -- control to x86_emulate eip 0x0 </FONT><BR> <FONT COLOR=3D"#000000">(XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. </FONT><BR> <BR> <FONT COLOR=3D"#000000">It shows cr0 is getting modified. But the eip is still 0x0. </FONT><BR> <BR> <BR> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Thanks & Regards,</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Nitin </FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">Open Source Technology Center, Intel Corporation.</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">-------------------------------------------------------------------------</FONT></FONT><BR> <FONT SIZE=3D"2"><FONT COLOR=3D"#00ff00">The mind is like a parachute; it works much better when it''s open.</FONT></FONT>=20 </TD> </TR> </TABLE> </BLOCKQUOTE> <TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%"> <TR> <TD> <BR> </TD> </TR> </TABLE> </BODY> </HTML> --=-uhYQ2q3+QGooJRTeY3Nk-- --=-+ytRGW3NwQ8RM8HFFBcy Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGDYAeZ1sfU7kTCR8RAsgmAJ9bi/bZ65Pq4Fde0m3PA3AgeNvbzACfVEZX lq5bEUfokynNs1IXxlnrAq8=BTF+ -----END PGP SIGNATURE----- --=-+ytRGW3NwQ8RM8HFFBcy-- --===============0537366310=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0537366310==-- From xen-devel-bounces.xensource.com Fri Mar 30 23:02:12 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 23:02:12 +0100 Received: from ppsw-9.csi.cam.ac.uk ([131.111.8.139]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXPAi-0003qV-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 23:02:12 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:54334 helo=lists.xensource.com) by ppsw-9.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.149]:25) with esmtp (csa=unknown) id 1HXPAO-0005Ln-VD (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 23:01:58 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXPBA-00017n-90; Fri, 30 Mar 2007 22:02:40 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXPAm-0000pj-Mf for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 22:02:16 +0000 Received: from e36.co.us.ibm.com ([32.97.110.154]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXPAj-0008I1-JT for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 22:02:14 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l2UM12k0029544 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 18:01:02 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UM10T5035780 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 16:01:02 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UM0x83013808 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 16:01:00 -0600 Received: from [9.48.49.200] (sig-9-48-49-200.mts.ibm.com [9.48.49.200]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UM0snH013457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Mar 2007 16:00:59 -0600 Message-ID: <460D8896.9050606@us.ibm.com> Date: Fri, 30 Mar 2007 17:00:54 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: Andi Kleen <andi@firstfloor.org> References: <4607074E.1030807@us.ibm.com> <p73mz1uqt5q.fsf@bingen.suse.de> <460D7F26.2080809@us.ibm.com> <20070330212548.GA10338@one.firstfloor.org> In-Reply-To: <20070330212548.GA10338@one.firstfloor.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.110.154 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Andi Kleen wrote:>> There are some hard problems with migrating into QEMU. Namely, the code >> that QEMU generates isn''t SMP safe (atomic instructions lose their >> atomicity) >> > > I see. > > You''re worrying that real mode startup trampolines of OS rely > on atomic instructions? I can''t think of much other possible real mode > multi CPU code. >No, that''s a concern for using V2E to handle 32 bit code. The big problem for handling real mode code is dealing with synchronization for device state. With the devices split between QEMU and within the hypervisor, this becomes even more complicated. Any of the interesting guests that use big real mode also depend on being able to synchronize this device state. Regards, Anthony Liguori> -Andi >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Fri Mar 30 23:13:04 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Fri, 30 Mar 2007 23:13:04 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXPLE-00040Y-00 for Keir.Fraser@cl.cam.ac.uk; Fri, 30 Mar 2007 23:13:04 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:39241 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXPKp-0005KA-0x (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Fri, 30 Mar 2007 23:12:44 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXPLZ-0002s5-Py; Fri, 30 Mar 2007 22:13:25 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXPLB-0002a8-8S for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 22:13:01 +0000 Received: from e32.co.us.ibm.com ([32.97.110.150]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXPL6-0008KP-Ao for xen-devel@lists.xensource.com; Fri, 30 Mar 2007 22:12:59 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.12.11.20060308/8.13.8) with ESMTP id l2UM9gwn003607 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 18:09:42 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l2UMBjHr198368 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 16:11:45 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l2UMBiRq031603 for <xen-devel@lists.xensource.com>; Fri, 30 Mar 2007 16:11:45 -0600 Received: from [9.48.49.200] (sig-9-48-49-200.mts.ibm.com [9.48.49.200]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l2UMBdiN031394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Mar 2007 16:11:44 -0600 Message-ID: <460D8B1B.6020308@us.ibm.com> Date: Fri, 30 Mar 2007 17:11:39 -0500 From: Anthony Liguori <aliguori@us.ibm.com> User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: "Kamble, Nitin A" <nitin.a.kamble@intel.com> References: <4607074E.1030807@us.ibm.com> <1175203075.27076.17.camel@lnitindesktop.sc.intel.com> <460C4AAE.5020707@us.ibm.com> <1175212362.27076.32.camel@lnitindesktop.sc.intel.com> <460C55BD.5050202@us.ibm.com> <1175216381.27076.39.camel@lnitindesktop.sc.intel.com> <1175221214.27076.43.camel@lnitindesktop.sc.intel.com> <460C8207.8000604@us.ibm.com> <1175280781.32115.13.camel@lnitindesktop.sc.intel.com> <460D5E34.2080803@us.ibm.com> <1175288913.32115.20.camel@lnitindesktop.sc.intel.com> <1175289886.32115.26.camel@lnitindesktop.sc.intel.com> In-Reply-To: <1175289886.32115.26.camel@lnitindesktop.sc.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 32.97.110.150 X-SA-Exim-Mail-From: aliguori@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: "Yu, Wilfred" <wilfred.yu@intel.com>, xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>, "Nakajima, Jun" <jun.nakajima@intel.com> Subject: [Xen-devel] Re: [PATCH][RFC] Emulating real mode with x86_emulate X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com Kamble, Nitin A wrote:> Anthony, > eip of 0x0 is the right address. > > Because the trampoline_Start code is relocated to address 0. > > /* Relocate real-mode trampoline to 0x0. */ > " mov $trampoline_start,%esi \n" > " xor %edi,%edi \n" > " mov $trampoline_end,%ecx \n" > " sub %esi,%ecx \n" > " rep movsb \n" > > Still there is no progress in the emulation. The guest is dying with > triple-fault just like before. > > Thanks & Regards, > Nitin > Open Source Technology Center, Intel Corporation. > ------------------------------------------------------------------------- > The mind is like a parachute; it works much better when it''s open. > > > On Fri, 2007-03-30 at 14:08 -0700, Nitin A Kamble wrote: >> Hi Anthony, >> >> On Fri, 2007-03-30 at 14:00 -0500, Anthony Liguori wrote: >>> /* Enter real mode, reload all segment registers and IDT. */ >>> " ljmp $0x8,$0x0 \n" >>> "trampoline_start: .code16 \n" >>> " mov %eax,%cr0 \n" >>> >>> That change was pretty recent so unless it was reverted it should Just Work. >>> >>> Regards, >>> >>> Anthony Liguori >>> >> Now I see cr0 is updated after returning from main. >> I enabled the debug log in the xen code now. >> >> (XEN) HVM2: Creating MP tables >> ... >> (XEN) HVM2: Loading Cirrus VGABIOS >> ... >> (XEN) HVM2: Loading ACPI >> ... >> (XEN) HVM2: Loading VMXAssist ... >> deadbeef >> (XEN) HVM2: >> foo >> (XEN) >> hvmop_emulate_realmode >> >> (XEN) guest requests real mode >> emulation >> (XEN) foo >> 221 >> (XEN) HVM2: Invoking ROMBIOS >> ... >> (XEN) vmx_vmexit_handler called. eip = >> 0x0 >> (XEN) vmx_cr_access called >> eip=0x0 >> (XEN) mov_to_cr 0 called >> eip=0x0 >> (XEN) vmx_set_cr0 called >> eip=0x0 >> (XEN) Transfering -- control to x86_emulate eip >> 0x0 >> (XEN) hvm.c:446:d2 Triple fault on VCPU0 - invoking HVM system reset. >> >> It shows cr0 is getting modified. But the eip is still 0x0.set_cr0 is returning 1 though which should increment eip to the next instruction. I''m a bit perplexed about my eip now and also why your eip is still 0. It should be the instruction following the mov cr0. Regards, Anthony Liguori>> >> Thanks & Regards, >> Nitin >> Open Source Technology Center, Intel Corporation. >> ------------------------------------------------------------------------- >> The mind is like a parachute; it works much better when it''s open. >> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 02:41:17 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 02:41:17 +0100 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXSaj-0006oD-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 02:41:17 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:56259 helo=lists.xensource.com) by ppsw-7.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.147]:25) with esmtp (csa=unknown) id 1HXSaO-00082Y-Ox (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 02:41:01 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXSb8-00027X-Kd; Sat, 31 Mar 2007 01:41:42 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXSal-0001pi-I9 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 01:41:19 +0000 Received: from igw2.watson.ibm.com ([129.34.20.6]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXSai-0002aL-Qf for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 01:41:17 +0000 Received: from mailhub3.watson.ibm.com (mailhub3.watson.ibm.com [129.34.20.45]) by igw2.watson.ibm.com (8.13.1/8.13.1/8.13.1-2005-04-25 igw) with ESMTP id l2V1fPq7014792; Fri, 30 Mar 2007 21:41:26 -0400 Received: from mailhub3.watson.ibm.com (localhost.localdomain [127.0.0.1]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-Delivery) with ESMTP id l2V1e4wK006690; Fri, 30 Mar 2007 21:40:04 -0400 Received: from 941e-2.watson.ibm.com (941e-2.watson.ibm.com [9.2.15.131]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-IMSS) with ESMTP id l2V1e4ZO006687; Fri, 30 Mar 2007 21:40:04 -0400 From: Stefan Berger <stefanb@us.ibm.com> To: xen-devel <xen-devel@lists.xensource.com> Content-Type: multipart/mixed; boundary="=-HLml01m+PfSeQ3GGFjIr" Date: Fri, 30 Mar 2007 21:44:55 -0400 Message-Id: <1175305495.3421.1.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) X-SA-Exim-Connect-IP: 129.34.20.6 X-SA-Exim-Mail-From: stefanb@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Ewan Mellor <ewan@xensource.com> Subject: [Xen-devel] [PATCH] [XM] Fix an indentation problem X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --=-HLml01m+PfSeQ3GGFjIr Content-Type: text/plain Content-Transfer-Encoding: 7bit This fixes a bug due to indentation. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> --=-HLml01m+PfSeQ3GGFjIr Content-Disposition: attachment; filename=xm_main_label_display_fix.diff Content-Type: text/x-patch; name=xm_main_label_display_fix.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -r b0b20a09d253 tools/python/xen/xm/main.py --- a/tools/python/xen/xm/main.py Fri Mar 30 19:02:40 2007 +0100 +++ b/tools/python/xen/xm/main.py Fri Mar 30 21:43:31 2007 -0400 @@ -929,10 +929,10 @@ def xm_label_list(doms): if security.active_policy not in [''INACTIVE'', ''NULL'', ''DEFAULT'']: if not d[''seclabel'']: d[''seclabel''] = ''ERROR'' - elif security.active_policy in [''DEFAULT'']: - d[''seclabel''] = ''DEFAULT'' - else: - d[''seclabel''] = ''INACTIVE'' + elif security.active_policy in [''DEFAULT'']: + d[''seclabel''] = ''DEFAULT'' + else: + d[''seclabel''] = ''INACTIVE'' output.append((format % d, d[''seclabel''])) --=-HLml01m+PfSeQ3GGFjIr Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-HLml01m+PfSeQ3GGFjIr-- From xen-devel-bounces.xensource.com Sat Mar 31 10:07:31 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 10:07:31 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXZYZ-0004iS-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 10:07:31 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:45061 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXZXf-0000jf-1k (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 10:06:41 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXZYO-0004hF-Kc; Sat, 31 Mar 2007 09:07:20 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXZY2-0004P1-C0 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 09:06:58 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[tCt+B4is/LvFWvuqqIzaXuy8BcQrsAaf]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXZXy-0000LB-P8 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 09:06:56 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXZWo-0004fC-00; Sat, 31 Mar 2007 10:05:42 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Sat, 31 Mar 2007 10:06:44 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Ryan Harper <ryanh@us.ibm.com> Message-ID: <C233E334.533E%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] numa=on broken Thread-Index: Acdzc+coJbNsPN9nEdufvgAWy6hiGQ=In-Reply-To: <20070330193958.GZ28736@us.ibm.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] numa=on broken X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 30/3/07 20:39, "Ryan Harper" <ryanh@us.ibm.com> wrote:>> Turning on by default is pointless because guests are not restricted to >> running on specific nodes by default. Since manual intervention is required >> to achieve that (right now at least) requiring numa=on is not much of a >> hardship. > > I''m getting ready to re-submit patches to export the topology information > so the userspace tools can use that info to make intelligent selections. > This was available back in October, but was never picked up, or even > commented upon.But can tools make sane automatic decisions on domain creation? And if tools decide not to use NUMA-ness of the system, should the Xen allocator still hoover up all the memory of the node that vcpu0 happens to start on? My primary concern is simply whether enabling NUMA by default can hurt performance, or cause problems by hitting certain memory nodes or memory zones harder than others, for the great majority of users who will not use NUMA (even if they have a small NUMA system like AMD K8). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 16:35:11 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 16:35:11 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfbj-0002KV-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 16:35:11 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:47650 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXfbT-0006fD-FX (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 16:35:00 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfcE-0000AP-A7; Sat, 31 Mar 2007 15:35:42 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfbr-0008KV-8m for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:35:19 +0000 Received: from atlrel9.hp.com ([156.153.255.214]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXfbo-00055p-Ie for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:35:17 +0000 Received: from smtp1.fc.hp.com (smtp.fc.hp.com [15.15.136.127]) by atlrel9.hp.com (Postfix) with ESMTP id CAE9C355C8 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 11:34:02 -0400 (EDT) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp1.fc.hp.com (Postfix) with ESMTP id A5AEB136FC1 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 15:34:02 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 7FB0013415B for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:34:02 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wNS+SjOKNMkI for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:33:56 -0600 (MDT) Received: from [127.0.0.1] (hplu.lsy [10.100.0.20]) by ldl.fc.hp.com (Postfix) with ESMTP id 7F33B134143 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:33:56 -0600 (MDT) From: Alex Williamson <alex.williamson@hp.com> To: xen-devel@lists.xensource.com In-Reply-To: <200703311252.l2VCqLaT019711@latara.uk.xensource.com> References: <200703311252.l2VCqLaT019711@latara.uk.xensource.com> Content-Type: text/plain Organization: HP OSLO R&D Date: Sat, 31 Mar 2007 09:33:56 -0600 Message-Id: <1175355236.13963.47.camel@bling> Mime-Version: 1.0 X-Mailer: Evolution 2.10.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 156.153.255.214 X-SA-Exim-Mail-From: alex.williamson@hp.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Sat, 2007-03-31 at 13:52 +0100, Xen staging patchbot-unstable wrote:> # HG changeset patch > # User Keir Fraser <keir@xensource.com> > # Date 1175345604 -3600 > # Node ID 5e65a86c8982b9159223b542cc7b7e3af61a06e4 > # Parent 7180d2e61f926023e24750c53fd4203a71f2a3ae > linux: User-space grant table device. > > A character device for accessing (in user-space) pages that have been > granted by other domains....> + /* This flag ensures that the page tables are not unpinned before the > + * VM area is unmapped. Therefore Xen still recognises the PTE as > + * belonging to an L1 pagetable, and the grant unmap operation will > + * succeed, even if the process does not exit cleanly. > + */ > + vma->vm_mm->context.has_foreign_mappings = 1;mm_context_t is arch specific, common code shouldn''t be poking at it like this. Alex -- Alex Williamson HP Open Source & Linux Org. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 16:37:05 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 16:37:05 +0100 Received: from ppsw-3.csi.cam.ac.uk ([131.111.8.133]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfdZ-0002MO-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 16:37:05 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:37103 helo=lists.xensource.com) by ppsw-3.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.143]:25) with esmtp (csa=unknown) id 1HXfdL-0003Ru-By (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 16:36:56 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfe7-0000Z3-Ea; Sat, 31 Mar 2007 15:37:39 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfdk-0000Fq-HY for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:37:16 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[A8Q8iwSFkn/xzrNdMVofpfYFzTSa5uM7]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXfdi-00056R-11 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:37:14 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfcU-0002QR-00; Sat, 31 Mar 2007 16:35:58 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Sat, 31 Mar 2007 16:36:59 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Alex Williamson <alex.williamson@hp.com>, <xen-devel@lists.xensource.com> Message-ID: <C2343EAB.5358%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. Thread-Index: AcdzqmuWqlESTN+dEduWXQAWy6hiGQ=In-Reply-To: <1175355236.13963.47.camel@bling> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 31/3/07 16:33, "Alex Williamson" <alex.williamson@hp.com> wrote:>> + /* This flag ensures that the page tables are not unpinned before the >> + * VM area is unmapped. Therefore Xen still recognises the PTE as >> + * belonging to an L1 pagetable, and the grant unmap operation will >> + * succeed, even if the process does not exit cleanly. >> + */ >> + vma->vm_mm->context.has_foreign_mappings = 1; > > mm_context_t is arch specific, common code shouldn''t be poking at it > like this.Good point. That part is entirely x86-specific. I''ll add an ifdef. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 16:47:57 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 16:47:57 +0100 Received: from ppsw-4.csi.cam.ac.uk ([131.111.8.134]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfo5-0002de-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 16:47:57 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:57726 helo=lists.xensource.com) by ppsw-4.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.144]:25) with esmtp (csa=unknown) id 1HXfnq-0005UT-Ef (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 16:47:47 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfob-0001P9-D7; Sat, 31 Mar 2007 15:48:29 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfnq-0000pr-Uz for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:47:42 +0000 Received: from igw2.watson.ibm.com ([129.34.20.6]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXfnk-00057c-9q for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:47:40 +0000 Received: from mailhub3.watson.ibm.com (mailhub3.watson.ibm.com [129.34.20.45]) by igw2.watson.ibm.com (8.13.1/8.13.1/8.13.1-2005-04-25 igw) with ESMTP id l2VFlh0c026509; Sat, 31 Mar 2007 11:47:43 -0400 Received: from mailhub3.watson.ibm.com (localhost.localdomain [127.0.0.1]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-Delivery) with ESMTP id l2VFkLnf001965; Sat, 31 Mar 2007 11:46:22 -0400 Received: from 941e-2.watson.ibm.com (941e-2.watson.ibm.com [9.2.15.131]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-IMSS) with ESMTP id l2VFkKGO001960; Sat, 31 Mar 2007 11:46:20 -0400 From: Stefan Berger <stefanb@us.ibm.com> To: xen-devel <xen-devel@lists.xensource.com> Content-Type: multipart/mixed; boundary="=-/DXvfZacLYZfOf0fm1z3" Date: Sat, 31 Mar 2007 11:51:13 -0400 Message-Id: <1175356273.8930.2.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) X-SA-Exim-Connect-IP: 129.34.20.6 X-SA-Exim-Mail-From: stefanb@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Ewan Mellor <ewan@xensource.com> Subject: [Xen-devel] [PATCH] [XM] Conversion of vtpm and access_control information X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --=-/DXvfZacLYZfOf0fm1z3 Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch converts vTPM and access_control lines in the (old-style) vm config files so a VM can be created using the Xen-API. I extended the DTD to the best of my knowledge, but to use xm with Xen-API I have to disable the DTD checking (skipdtd). Signed-off-by: Stefan Berger <stefanb@us.ibm.com> --=-/DXvfZacLYZfOf0fm1z3 Content-Disposition: attachment; filename=xm_vtpm_xenapi_create.py Content-Type: text/x-patch; name=xm_vtpm_xenapi_create.py; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/tools/python/xen/xm/xenapi_create.py ==================================================================--- root.orig/xen-unstable.hg/tools/python/xen/xm/xenapi_create.py +++ root/xen-unstable.hg/tools/python/xen/xm/xenapi_create.py @@ -265,9 +265,15 @@ class xenapi_create: "platform": get_child_nodes_as_dict(vm, "platform", "key", "value"), "other_config": - get_child_nodes_as_dict(vm, "other_config", "key", "value") + get_child_nodes_as_dict(vm, "other_config", "key", "value"), } + if vm.attributes.has_key("security_label"): + vm_record.update({ + "security_label": + vm.attributes["security_label"].value + }) + if len(vm.getElementsByTagName("pv")) > 0: vm_record.update({ "PV_bootloader": @@ -308,6 +314,12 @@ class xenapi_create: self.create_vifs(vm_ref, vifs) + # Now create vtpms + + vtpms = vm.getElementsByTagName("vtpm") + + self.create_vtpms(vm_ref, vtpms) + # Now create consoles consoles = vm.getElementsByTagName("console") @@ -397,6 +409,21 @@ class xenapi_create: self._network_refs = server.xenapi.network.get_all() return self._network_refs.pop(0) + def create_vtpms(self, vm_ref, vtpms): + if len(vtpms) > 1: + vtpms = [ vtpms[0] ] + log(DEBUG, "create_vtpms") + return map(lambda vtpm: self.create_vtpm(vm_ref, vtpm), vtpms) + + def create_vtpm(self, vm_ref, vtpm): + vtpm_record = { + "VM": + vm_ref, + "backend": + vtpm.attributes["backend"].value + } + return server.xenapi.VTPM.create(vtpm_record) + def create_consoles(self, vm_ref, consoles): log(DEBUG, "create_consoles") return map(lambda console: self.create_console(vm_ref, console), @@ -438,6 +465,10 @@ class sxp2xml: vifs_sxp = map(lambda x: x[1], [device for device in devices if device[1][0] == "vif"]) + + vtpms_sxp = map(lambda x: x[1], [device for device in devices + if device[1][0] == "vtpm"]) + # Create XML Document impl = getDOMImplementation() @@ -487,6 +518,14 @@ class sxp2xml: vm.attributes["vcpus_at_startup"] \ = str(get_child_by_name(config, "vcpus", 1)) + sec_data = get_child_by_name(config, "security") + if sec_data: + try : + vm.attributes[''security_label''] = \ + "sHype:%s:%s" % (sec_data[0][1][1],sec_data[0][2][1]) + except: + raise "Invalid security data format: %s" % str(sec_data) + # Make the name tag vm.appendChild(self.make_name_tag( @@ -557,6 +596,12 @@ class sxp2xml: map(vm.appendChild, vifs) + # And now the vTPMs + + vtpms = map(lambda vtpm: self.extract_vtpm(vtpm, document), vtpms_sxp) + + map(vm.appendChild, vtpms) + # Last but not least the consoles... consoles = self.extract_consoles(image, document) @@ -664,6 +709,14 @@ class sxp2xml: return vif + def extract_vtpm(self, vtpm_sxp, document): + + vtpm = document.createElement("vtpm") + vtpm.attributes["backend"] \ + = get_child_by_name(vtpm_sxp, "backend", "0") + + return vtpm + _eths = -1 def mk_other_config(self, key, value, document): Index: root/xen-unstable.hg/tools/python/xen/xm/create.dtd ==================================================================--- root.orig/xen-unstable.hg/tools/python/xen/xm/create.dtd +++ root/xen-unstable.hg/tools/python/xen/xm/create.dtd @@ -37,6 +37,7 @@ memory, vbd*, vif*, + vtpm*, console*, platform*, vcpu_param*, @@ -73,6 +74,10 @@ qos_algorithm_type CDATA #REQUIRED network CDATA #IMPLIED> +<!ELEMENT vtpm (name)> +<!ATTLIST vtpm %NAMEID; + backend CDATA #REQUIRED> + <!ELEMENT console (other_config*)> <!ATTLIST console protocol (vt100|rfb|rdp) #REQUIRED> --=-/DXvfZacLYZfOf0fm1z3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-/DXvfZacLYZfOf0fm1z3-- From xen-devel-bounces.xensource.com Sat Mar 31 16:48:07 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 16:48:07 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfoE-0002WT-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 16:48:06 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:52332 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXfnJ-00010k-1x (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 16:47:17 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfo4-00012C-7l; Sat, 31 Mar 2007 15:47:56 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfng-0000jb-T8 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:47:32 +0000 Received: from atlrel9.hp.com ([156.153.255.214]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXfne-00057Y-9a for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:47:30 +0000 Received: from smtp1.fc.hp.com (smtp.fc.hp.com [15.15.136.127]) by atlrel9.hp.com (Postfix) with ESMTP id 681D9349E4 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 11:46:19 -0400 (EDT) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp1.fc.hp.com (Postfix) with ESMTP id 3DEA4136F9A for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 15:46:19 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 1562A134143 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:46:19 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qda2DoLPqn-c for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:46:13 -0600 (MDT) Received: from [127.0.0.1] (hplu.lsy [10.100.0.20]) by ldl.fc.hp.com (Postfix) with ESMTP id 956C939C03E for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:46:12 -0600 (MDT) From: Alex Williamson <alex.williamson@hp.com> To: xen-devel@lists.xensource.com In-Reply-To: <200703311252.l2VCqLaT019711@latara.uk.xensource.com> References: <200703311252.l2VCqLaT019711@latara.uk.xensource.com> Content-Type: text/plain Organization: HP OSLO R&D Date: Sat, 31 Mar 2007 09:46:11 -0600 Message-Id: <1175355971.13963.50.camel@bling> Mime-Version: 1.0 X-Mailer: Evolution 2.10.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 156.153.255.214 X-SA-Exim-Mail-From: alex.williamson@hp.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On Sat, 2007-03-31 at 13:52 +0100, Xen staging patchbot-unstable wrote:> --- a/linux-2.6-xen-sparse/drivers/xen/util.c Sat Mar 31 12:42:02 2007 +0100 > +++ b/linux-2.6-xen-sparse/drivers/xen/util.c Sat Mar 31 13:53:24 2007 +0100 > @@ -4,6 +4,23 @@ > #include <linux/vmalloc.h> > #include <asm/uaccess.h> > #include <xen/driver_util.h> > + > +struct class *get_xen_class(void) > +{ > + static struct class *xen_class; > + > + if (xen_class) > + return xen_class; > + > + xen_class = class_create(THIS_MODULE, "xen"); > + if (IS_ERR(xen_class)) { > + printk("Failed to create xen sysfs class.\n"); > + xen_class = NULL; > + } > + > + return xen_class; > +} > +EXPORT_SYMBOL_GPL(get_xen_class);Maybe this could be moved to a more common spot since only x86 builds with CONFIG_XEN_UTIL? Thanks, Alex -- Alex Williamson HP Open Source & Linux Org. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 16:53:11 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 16:53:11 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXft9-0002kX-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 16:53:11 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:45875 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXfsW-0002rX-0z (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 16:52:38 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXftH-0001nh-Or; Sat, 31 Mar 2007 15:53:19 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfss-0001Ur-Ui for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:52:54 +0000 Received: from igw2.watson.ibm.com ([129.34.20.6]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXfsq-0005MA-85 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:52:52 +0000 Received: from mailhub3.watson.ibm.com (mailhub3.watson.ibm.com [129.34.20.45]) by igw2.watson.ibm.com (8.13.1/8.13.1/8.13.1-2005-04-25 igw) with ESMTP id l2VFr2LB030001; Sat, 31 Mar 2007 11:53:02 -0400 Received: from mailhub3.watson.ibm.com (localhost.localdomain [127.0.0.1]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-Delivery) with ESMTP id l2VFpeuD003176; Sat, 31 Mar 2007 11:51:41 -0400 Received: from 941e-2.watson.ibm.com (941e-2.watson.ibm.com [9.2.15.131]) by mailhub3.watson.ibm.com (8.13.1/8.13.1/8.13.1-01-23-2007-IMSS) with ESMTP id l2VFpeuc003173; Sat, 31 Mar 2007 11:51:40 -0400 From: Stefan Berger <stefanb@us.ibm.com> To: xen-devel <xen-devel@lists.xensource.com> Content-Type: multipart/mixed; boundary="=-CgHDo75QiRSutQTtemG4" Date: Sat, 31 Mar 2007 11:56:33 -0400 Message-Id: <1175356593.8930.6.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) X-SA-Exim-Connect-IP: 129.34.20.6 X-SA-Exim-Mail-From: stefanb@us.ibm.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: Ewan Mellor <ewan@xensource.com> Subject: [Xen-devel] [PATCH] [libxen] serialize string string maps X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com --=-CgHDo75QiRSutQTtemG4 Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch adds the functionality to serialize string string maps -- serializing other maps should be easy to add. I''ll need this for one of my extensions (later). Signed-off-by: Stefan Berger <stefanb@us.ibm.com> --=-CgHDo75QiRSutQTtemG4 Content-Disposition: attachment; filename=libxen_serialize_string_string_map.c Content-Type: text/x-patch; name=libxen_serialize_string_string_map.c; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/tools/libxen/src/xen_common.c ==================================================================--- root.orig/xen-unstable.hg/tools/libxen/src/xen_common.c +++ root/xen-unstable.hg/tools/libxen/src/xen_common.c @@ -102,6 +102,9 @@ add_struct_value(const struct abstract_t const char *), const char *, xmlNode *); +static xmlNode * +add_container(xmlNode *parent, const char *name); + static void call_raw(xen_session *, const char *, abstract_value [], int, const abstract_type *, void *); @@ -1290,6 +1293,48 @@ make_body_add_type(enum abstract_typenam } break; + case MAP: + { + const struct struct_member *member = v->type->members; + arbitrary_map *map_val = v->u.struct_val; + xmlNode *param_node = add_param_struct(params_node); + for (size_t i = 0; i < map_val->size; i++) { + enum abstract_typename typename_key = member[0].type->typename; + enum abstract_typename typename_val = member[1].type->typename; + int offset_key = member[0].offset; + int offset_val = member[1].offset; + int struct_size = v->type->struct_size; + + switch (typename_key) { + case STRING: { + char **addr = (void *)(map_val + 1) + + (i * struct_size) + + offset_key; + char *key = *addr; + + switch (typename_val) { + case STRING: { + char *val; + addr = (void *)(map_val + 1) + + (i * struct_size) + + offset_val; + val = *addr; + add_struct_member(param_node, key, "string", val); + break; + } + default: + assert(false); + } + break; + } + default: + assert(false); + } + } + } + break; + + default: assert(false); } --=-CgHDo75QiRSutQTtemG4 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-CgHDo75QiRSutQTtemG4-- From xen-devel-bounces.xensource.com Sat Mar 31 16:56:56 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 16:56:56 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfwm-0002hr-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 16:56:56 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:40733 helo=lists.xensource.com) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXfw9-0004v7-0w (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 16:56:23 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfwv-0002C9-4D; Sat, 31 Mar 2007 15:57:05 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfwX-0001tT-D9 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:56:41 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[NqcaRJbuSS5UDf7yCJ9e8r/2fKDuqqk6]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXfwS-0005UO-Qx for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:56:39 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfvK-0002nd-00; Sat, 31 Mar 2007 16:55:26 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Sat, 31 Mar 2007 16:56:29 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Alex Williamson <alex.williamson@hp.com>, <xen-devel@lists.xensource.com> Message-ID: <C234433D.5360%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. Thread-Index: AcdzrST2Y12sdt+gEduWXQAWy6hiGQ=In-Reply-To: <1175355971.13963.50.camel@bling> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 31/3/07 16:46, "Alex Williamson" <alex.williamson@hp.com> wrote:> Maybe this could be moved to a more common spot since only x86 builds > with CONFIG_XEN_UTIL? Thanks,You can''t get much more generic than a file named ''util.c'' at the root of drivers/xen. Everyone should build it and the x86-specific portions (if there really are any -- it all looks pretty generic to me even if no other architectures currently use the functions defined in there) should be ifdef''ed or perhaps relocated to a new file. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 16:57:53 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 16:57:53 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXfxh-0002re-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 16:57:53 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:34749 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXfxN-0005iD-87 (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 16:57:38 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfy9-0002Yj-DF; Sat, 31 Mar 2007 15:58:21 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXfxl-0002GP-QG for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:57:57 +0000 Received: from atlrel6.hp.com ([156.153.255.205]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXfxh-0005V2-SI for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 15:57:55 +0000 Received: from smtp1.fc.hp.com (smtp1.fc.hp.com [15.15.136.127]) by atlrel6.hp.com (Postfix) with ESMTP id DFB1B35251 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 11:56:42 -0400 (EDT) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp1.fc.hp.com (Postfix) with ESMTP id BAC98137090 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 15:56:42 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 75DE539C03E for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:56:42 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VXaXr1l-86uQ for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:56:36 -0600 (MDT) Received: from [127.0.0.1] (hplu.lsy [10.100.0.20]) by ldl.fc.hp.com (Postfix) with ESMTP id CE22B134143 for <xen-devel@lists.xensource.com>; Sat, 31 Mar 2007 09:56:35 -0600 (MDT) From: Alex Williamson <alex.williamson@hp.com> To: xen-devel@lists.xensource.com In-Reply-To: <200703311252.l2VCqJiC019689@latara.uk.xensource.com> References: <200703311252.l2VCqJiC019689@latara.uk.xensource.com> Content-Type: text/plain Organization: HP OSLO R&D Date: Sat, 31 Mar 2007 09:56:35 -0600 Message-Id: <1175356595.13963.52.camel@bling> Mime-Version: 1.0 X-Mailer: Evolution 2.10.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 156.153.255.205 X-SA-Exim-Mail-From: alex.williamson@hp.com X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Subject: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: Add a hook before a page table entry is cleared, for use with X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com This doesn''t work very well for archs that don''t define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL as ptep_get_and_clear_full is then defined as a macro. I''d suggest a different name to avoid conflicts. Thanks, Alex On Sat, 2007-03-31 at 13:52 +0100, Xen staging patchbot-unstable wrote:> # HG changeset patch > # User Keir Fraser <keir@xensource.com> > # Date 1175341322 -3600 > # Node ID 7180d2e61f926023e24750c53fd4203a71f2a3ae > # Parent 2de267ba9a76e1358601505e16786969f317aa7d > linux: Add a hook before a page table entry is cleared, for use with > the grant-table device. > > Signed-off-by: Derek Murray <Derek.Murray@cl.cam.ac.uk> > --- > linux-2.6-xen-sparse/include/linux/mm.h | 5 +++++ > linux-2.6-xen-sparse/mm/memory.c | 12 ++++++++++-- > 2 files changed, 15 insertions(+), 2 deletions(-) > > diff -r 2de267ba9a76 -r 7180d2e61f92 linux-2.6-xen-sparse/include/linux/mm.h > --- a/linux-2.6-xen-sparse/include/linux/mm.h Sat Mar 31 12:26:04 2007 +0100 > +++ b/linux-2.6-xen-sparse/include/linux/mm.h Sat Mar 31 12:42:02 2007 +0100 > @@ -205,6 +205,11 @@ struct vm_operations_struct { > /* notification that a previously read-only page is about to become > * writable, if an error is returned it will cause a SIGBUS */ > int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); > + /* Area-specific function for clearing the PTE at @ptep. Returns the > + * original value of @ptep. */ > + pte_t (*ptep_get_and_clear_full)(struct vm_area_struct *vma, > + unsigned long addr, pte_t *ptep, > + int is_fullmm); > #ifdef CONFIG_NUMA > int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); > struct mempolicy *(*get_policy)(struct vm_area_struct *vma, > diff -r 2de267ba9a76 -r 7180d2e61f92 linux-2.6-xen-sparse/mm/memory.c > --- a/linux-2.6-xen-sparse/mm/memory.c Sat Mar 31 12:26:04 2007 +0100 > +++ b/linux-2.6-xen-sparse/mm/memory.c Sat Mar 31 12:42:02 2007 +0100 > @@ -659,8 +659,15 @@ static unsigned long zap_pte_range(struc > page->index > details->last_index)) > continue; > } > - ptent = ptep_get_and_clear_full(mm, addr, pte, > - tlb->fullmm); > + if (unlikely(vma->vm_ops && > + vma->vm_ops->ptep_get_and_clear_full)) > + ptent = vma->vm_ops-> > + ptep_get_and_clear_full(vma, addr, > + pte, > + tlb->fullmm); > + else > + ptent = ptep_get_and_clear_full(mm, addr, pte, > + tlb->fullmm); > tlb_remove_tlb_entry(tlb, pte, addr); > if (unlikely(!page)) > continue; > @@ -755,6 +762,7 @@ static unsigned long unmap_page_range(st > details = NULL; > > BUG_ON(addr >= end); > + > tlb_start_vma(tlb, vma); > pgd = pgd_offset(vma->vm_mm, addr); > do { > > _______________________________________________ > Xen-staging mailing list > Xen-staging@lists.xensource.com > http://lists.xensource.com/xen-staging >-- Alex Williamson HP Open Source & Linux Org. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 17:08:00 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 17:08:00 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXg7U-0002r4-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 17:08:00 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:32906 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXg7E-0002Wm-8E (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 17:07:50 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXg7z-0004Qz-Jy; Sat, 31 Mar 2007 16:08:31 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXg7b-00048a-Va for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 16:08:07 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[xhtdrHMSH2OEe6U8PZ2K7VL66d8Py9en]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXg7Z-0005Xf-I3 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 16:08:05 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXg6Q-00034H-00; Sat, 31 Mar 2007 17:06:54 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Sat, 31 Mar 2007 17:07:56 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Alex Williamson <alex.williamson@hp.com>, <xen-devel@lists.xensource.com> Message-ID: <C23445EC.5365%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: Add a hook before a page table entry is cleared, for use with Thread-Index: Acdzrr5y/T1LAt+hEduWXQAWy6hiGQ=In-Reply-To: <1175356595.13963.52.camel@bling> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: Add a hook before a page table entry is cleared, for use with X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 31/3/07 16:56, "Alex Williamson" <alex.williamson@hp.com> wrote:> This doesn''t work very well for archs that don''t define > __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL as ptep_get_and_clear_full is then > defined as a macro. I''d suggest a different name to avoid conflicts.That''s a bit of a pain. I''ll change to zap_pte. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel From xen-devel-bounces.xensource.com Sat Mar 31 17:35:46 2007 Return-path: <alex.williamson@hp.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 17:35:46 +0100 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXgYM-0003Uf-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 17:35:46 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from atlrel8.hp.com ([156.153.255.206]:41524) by ppsw-0.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.140]:25) with esmtp (csa=unknown) id 1HXgXL-00086w-1o (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <alex.williamson@hp.com>); Sat, 31 Mar 2007 17:34:43 +0100 Received: from smtp1.fc.hp.com (smtp1.fc.hp.com [15.15.136.127]) by atlrel8.hp.com (Postfix) with ESMTP id 975AA34FBC; Sat, 31 Mar 2007 12:34:44 -0400 (EDT) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp1.fc.hp.com (Postfix) with ESMTP id 73CF0136EE7; Sat, 31 Mar 2007 16:34:37 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 35A6513415B; Sat, 31 Mar 2007 10:34:37 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ySwHvx0KBNwf; Sat, 31 Mar 2007 10:34:30 -0600 (MDT) Received: from [127.0.0.1] (hplu.lsy [10.100.0.20]) by ldl.fc.hp.com (Postfix) with ESMTP id 246AB134143; Sat, 31 Mar 2007 10:34:30 -0600 (MDT) Subject: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. From: Alex Williamson <alex.williamson@hp.com> To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> Cc: xen-devel@lists.xensource.com In-Reply-To: <C234433D.5360%Keir.Fraser@cl.cam.ac.uk> References: <C234433D.5360%Keir.Fraser@cl.cam.ac.uk> Content-Type: text/plain Organization: HP OSLO R&D Date: Sat, 31 Mar 2007 10:34:29 -0600 Message-Id: <1175358869.13963.60.camel@bling> Mime-Version: 1.0 X-Mailer: Evolution 2.10.0 Content-Transfer-Encoding: 7bit On Sat, 2007-03-31 at 16:56 +0100, Keir Fraser wrote:> On 31/3/07 16:46, "Alex Williamson" <alex.williamson@hp.com> wrote: > > > Maybe this could be moved to a more common spot since only x86 builds > > with CONFIG_XEN_UTIL? Thanks, > > You can''t get much more generic than a file named ''util.c'' at the root of > drivers/xen. > > Everyone should build it and the x86-specific portions (if there really are > any -- it all looks pretty generic to me even if no other architectures > currently use the functions defined in there) should be ifdef''ed or perhaps > relocated to a new file.True, util.c ought to be a good place to dump stuff like this. Unfortunately we define our own alloc/free_vm_area(), so the existing functions in there are the problems. Maybe those should be moved to arch/i386/mach-xen/util.c, or ifdef out as below. Thanks, Alex Signed-off-by: Alex Williamson <alex.williamson@hp.com> --- diff -r fbe52b559161 linux-2.6-xen-sparse/arch/ia64/Kconfig --- a/linux-2.6-xen-sparse/arch/ia64/Kconfig Sat Mar 31 14:05:57 2007 +0100 +++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig Sat Mar 31 10:24:30 2007 -0600 @@ -577,7 +577,7 @@ source "crypto/Kconfig" # if XEN config XEN_UTIL - default n + default y config XEN_BALLOON default y diff -r fbe52b559161 linux-2.6-xen-sparse/drivers/xen/util.c --- a/linux-2.6-xen-sparse/drivers/xen/util.c Sat Mar 31 14:05:57 2007 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/util.c Sat Mar 31 10:24:01 2007 -0600 @@ -21,6 +21,8 @@ struct class *get_xen_class(void) return xen_class; } EXPORT_SYMBOL_GPL(get_xen_class); + +#ifndef CONFIG_IA64 static int f(pte_t *pte, struct page *pmd_page, unsigned long addr, void *data) { @@ -63,3 +65,5 @@ void free_vm_area(struct vm_struct *area kfree(area); } EXPORT_SYMBOL_GPL(free_vm_area); + +#endif /* !CONFIG_IA64 */ From xen-devel-bounces.xensource.com Sat Mar 31 18:28:35 2007 Return-path: <xen-devel-bounces@lists.xensource.com> Envelope-to: Keir.Fraser@cl.cam.ac.uk Delivery-date: Sat, 31 Mar 2007 18:28:35 +0100 Received: from ppsw-2.csi.cam.ac.uk ([131.111.8.132]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXhNT-0004OR-00 for Keir.Fraser@cl.cam.ac.uk; Sat, 31 Mar 2007 18:28:35 +0100 X-Cam-SpamDetails: scanned, SpamAssassin-3.1.7 (score=0) X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from vm04-bcn-london.deploy.xenoserver.org ([217.147.82.229]:34826 helo=lists.xensource.com) by ppsw-2.csi.cam.ac.uk (mx.cam.ac.uk [131.111.8.142]:25) with esmtp (csa=unknown) id 1HXhND-0004RA-8I (Exim 4.63) for Keir.Fraser@cl.cam.ac.uk (return-path <xen-devel-bounces@lists.xensource.com>); Sat, 31 Mar 2007 18:28:24 +0100 Received: from localhost ([127.0.0.1] helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXhNl-00086r-T4; Sat, 31 Mar 2007 17:28:53 +0000 Received: from [192.168.0.10] (helo=lists.xensource.com) by host-192-168-0-1-bcn-london with esmtp (Exim 4.50) id 1HXhNP-0007oM-13 for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 17:28:31 +0000 Received: from mta2.cl.cam.ac.uk ([128.232.0.14] ident=[TL8YuTRnGjjXZvoMXP0Ss1wD5H8UXwd9]) by lists.xensource.com with esmtp (Exim 4.50) id 1HXhNM-0006fS-5a for xen-devel@lists.xensource.com; Sat, 31 Mar 2007 17:28:28 +0000 Received: from c058.vpn.cl.cam.ac.uk ([128.232.105.58]) by mta2.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1HXhMD-0004Mq-00; Sat, 31 Mar 2007 18:27:17 +0100 User-Agent: Microsoft-Entourage/11.3.3.061214 Date: Sat, 31 Mar 2007 18:28:18 +0100 From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk> To: Alex Williamson <alex.williamson@hp.com> Message-ID: <C23458C2.536C%Keir.Fraser@cl.cam.ac.uk> Thread-Topic: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. Thread-Index: AcdzufiUNyi48N+tEduWXQAWy6hiGQ=In-Reply-To: <1175358869.13963.60.camel@bling> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SA-Exim-Connect-IP: 128.232.0.14 X-SA-Exim-Mail-From: keir.fraser@cl.cam.ac.uk X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on (none) X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Subject: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] linux: User-space grant table device. X-SA-Exim-Version: 4.2.1 (built Mon, 27 Mar 2006 13:42:28 +0200) X-SA-Exim-Scanned: Yes (on lists.xensource.com) Cc: xen-devel@lists.xensource.com X-BeenThere: xen-devel@lists.xensource.com X-Mailman-Version: 2.1.5 Precedence: list List-Id: Xen developer discussion <xen-devel.lists.xensource.com> List-Unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xensource.com> List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help> List-Subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com On 31/3/07 17:34, "Alex Williamson" <alex.williamson@hp.com> wrote:>> Everyone should build it and the x86-specific portions (if there really are >> any -- it all looks pretty generic to me even if no other architectures >> currently use the functions defined in there) should be ifdef''ed or perhaps >> relocated to a new file. > > True, util.c ought to be a good place to dump stuff like this. > Unfortunately we define our own alloc/free_vm_area(), so the existing > functions in there are the problems. Maybe those should be moved to > arch/i386/mach-xen/util.c, or ifdef out as below. Thanks,Oh I see. Actually I think the difference is not strictly architecture-related, but due to the fact that ia64 uses auto-translate, so you need actual pseudophysical addresses relating to the virtual address that is returned. The right answer here is to have a combined function that tests for auto_translated_physmap. Possibly the interface function should even be modified to do allocate-area-and-map, rather than leaving the mapping to a separate function. Anyhow, for now I''ll make the ''generic'' versions __attribute__((weak)). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel